In 1994, I was wandering around the Grand Bazaar in Istanbul when a bomb went off in the next street. At first I thought a cooking stove had blown up, but then heavily armed police and soldiers poured into the building and shouted at us to leave. Later in the day, I discovered that two people had been killed and many others injured. It was my first visit to Turkey, and a shocking introduction to the armed conflict between the Turkish government and the Kurdistan Workers' Party (PKK).
Last year, the PKK's imprisoned leader, Abdullah Ocalan, called for a ceasefire. By then, the conflict had been going for almost 30 years and killed around 42,000 people; most of the dead were Kurdish insurgents or civilians but the fatalities included more than 6,500 members of the Turkish security forces. This is the background to the otherwise bewildering behaviour of Turkey, which has tanks stationed within sight of the besieged Syrian town of Kobani. Last week, as mainly Kurdish fighters fought street battles with Islamic State, also known as Isis, Turkish forces watched and did nothing.
To an outside observer, it might seem reasonable to assume that Turkey's leaders would be dismayed at the prospect of a swathe of Syria falling under the control of a group so extreme that it split from al-Qaeda's affiliate, Jabhat al-Nusra. Turkey is a member of Nato and supports, nominally at least, US policy towards Syria and Iraq. It has the second-largest army in Nato and shares a long border with Syria, which puts it in a better position to intervene than most of the countries with a stake in the conflict.
But the Turkish government has a dreadful history of human-rights abuses, many of them carried out against its own Kurdish population. For decades, the Kurdish language was banned and its very existence denied by people who claimed that the Kurds were actually "mountain Turks". Successive Turkish governments treated the country's largest ethnic minority – around 14 million people, or 18 per cent of the population, although even those figures are contested – as if they did not exist. International human rights organisations reported the use of torture, extra-judicial executions and the destruction of thousands of Kurdish villages, while the PKK's response became equally vicious. Some restrictions on the Kurdish language were lifted when Turkey began eyeing membership of the EU, but the country's current president, Recep Tayyip Erdogan, has different priorities.
Now he claims that the PKK and Isis are "the same", identifying them as twin evils. This is disingenuous, for his government – he was prime minister for 11 years before being elected president – has been accused of supplying Islamic extremists in Syria with weapons in the hope of them overthrowing President Bashar al-Assad. Last month, a former US ambassador to Turkey, Francis Ricciardone, even accused the country's government of working with Jabhat al-Nusra. "The Turks, frankly, worked with groups for a period, including al-Nusra, whom… we're not willing to work with," he said.
Turkish officials angrily denied claims that the country helped an alliance of Islamist groups, including al-Nusra, to attack the Syrian town of Kasab as recently as March this year. But Human Rights Watch interviewed local people and said that Islamists crossed into Syria from Turkish territory.
Now the siege of Kobani, which is in an area of Syria heavily populated by Kurds, is reigniting Turkey's conflict with its own Kurdish minority. The government reacted with alarm to an appeal last month from the PKK, which called on Turkish Kurds to join in the defence of Kobani. Turkish security forces have been preventing Kurdish volunteers crossing the border into Syria, prompting protests in half a dozen cities, including Ankara and Istanbul. Last week, at least two dozen people died when demonstrators were met with tear gas and water cannon.
Even before the latest deaths, it was clear that the current Turkish government is brutal in its instincts and partisan towards its own rural, conservative supporters. Last year, popular protests against a plan to turn Gezi Park in Turkey's most cosmopolitan city, Istanbul, into a shopping mall were met with similar brutality. At least four people were killed and 8,000 injured, including almost a dozen who lost an eye after being struck in the head by plastic bullets. Attempts to censor social networking sites met with widespread derision and were overturned by the courts, but Turkey's descent into authoritarianism cannot be denied.
As news of atrocities filters out from Kobani, the town has become the focus of the struggle against Isis. Two days ago, the UN refugee agency said that more than 170,000 refugees had fled the town and the surrounding area, many of them crossing the border into Turkey. Kurdish fighters, assisted by American bombing raids, have put up fierce resistance but Turkey's political crisis is growing. Erdogan faces civil unrest, pressure from his Nato allies and an explicit threat from the jailed PKK leader, Ocalan, of a resumption of hostilities if Kobani falls to Isis.
Turkey has responded with its own list of demands, including a no-fly zone inside the Syrian border. It says it can't be expected to lead a ground operation against Isis on its own, blaming the Assad regime for instability in the region. There is some truth in this, but one of Turkey's greatest fears is the prospect of an autonomous Kurdish enclave across the border in Syria.
At a moment when Nato needs the country to play a decisive role, Turkey's dreadful record towards its own minorities has come back to haunt it. Those stationary tanks are a grim reminder that the Kurds, currently the West's most effective allies in the conflict with Isis, still scare the life out of Ankara.