IN THE early hours of April 9th a group of Syrian civilians fled to the Turkish border as clashes between insurgents from the Free Syrian Army (FSA) and Syrian government forces raged. Two Syrians died and several others, including two Turks, were wounded when Syrian troops fired on the civilians' destination, a refugee camp located in the Turkish province of Kilis.

The incident has unleashed much speculation that Turkey will at last act on its many veiled threats to move against Syria. For several months the prime minister, Recep Tayyip Erdogan (pictured above), has been muttering about taking unspecified measures against Bashar Assad, Syria's president, once a friend and ally. Since last summer Turkey has hosted FSA leaders on its soil amid claims that it is (modestly) arming the rebels. Officials deny this but acknowledge that regime change in Syria is a priority. Only America's reluctance to become entangled in a fresh conflict stands in the way of some form of direct Turkish intervention. For how long?

Until recently the question would have been unthinkable. Turkey's foreign policy has long been guided by Ataturk's dictum “peace at home, peace in the world.” Only last year Mr Erdogan was railing against “imperialist designs” in Libya. NATO (of which Turkey has been a member since 1952) had “no business there” he said, before belatedly joining its operations. Even then Turkish forces stayed out of combat.

Over the past decade, under Mr Erdogan's government, Turkey embarked on an activist foreign policy, courting Iran and long-forgotten Arab neighbours as the European Union cooled on Turkey's aspirations to join. With one foot in the West and the other in the Middle East, Turkey was able to mediate between Lebanon's rival factions, between Iraq's Shias and Sunnis, and between Israel and Syria (until Israel's 2009 assault against Gaza). “It was this ability to talk to all sides that made Turkey an effective player,” says Nikolaos van Dam, a former Dutch ambassador to Turkey. But “now it has chosen sides.”

This shift could have far-reaching consequences. What lies behind it? When unrest erupted in Syria last spring, Ahmet Davutoglu, the foreign minister, spent hours pleading with Mr Assad to stop the violence and begin reforms. Yet the slaughter went on and Syrian refugees poured into Turkey—some 25,000 at the last count.

By August Mr Erdogan had executed a 180-degree turn, declaring that Mr Assad would “end up like Qaddafi”. Turkey's Western friends are delighted that Mr Erdogan has dumped Mr Assad. Yet some fail to understand why Turkey did not first seek to continue the role of mediator in Syria.

One explanation is simply that Turkey, like so many, believed that Mr Assad's end was nigh. A more worrying possibility is hubris. Increasingly authoritarian and rarely challenged by his circle of sycophants, Mr Erdogan is used to getting his own way. Mr Assad dared to defy him. Mr Erdogan's party has “extraordinary neo-Ottoman ambitions”, wrote Timothy Garton Ash, a British historian, in a Turkish daily. But it “should be careful not to overestimate its possibilities”.

Mr Erdogan's secular critics argue that his behaviour points to another troubling impulse: to lead an arc of Sunni Muslim countries spanning Africa, Asia, the Balkans and the Middle East. As evidence they point to Turkey's coddling of Syria's Muslim Brotherhood. “They want to counter Iran, and America is encouraging this,” says Faruk Logoglu, a deputy for the opposition Republican People's Party (CHP). Mr Erdogan's AK party, he adds, has also begun to embrace Islam more firmly at home, suggesting some influence of religious ideology over foreign policy.

Zero problems with (Sunni) neighbours

Since AK won a third consecutive term last summer, Mr Erdogan has been pandering to his pious base. He recently rammed through controversial legislation allowing middle-school students to enroll in imam hatip schools, where Muslim clerics are trained, and to study the Koran in state schools. These days, when Mr Erdogan attacks Kemal Kilicdaroglu, the CHP leader, he draws attention to his membership of the minority Alevi faith.

He has even suggested that Mr Kilicdaroglu opposes intervention in Syria out of a sense of kinship with Mr Assad, who belongs to the Alawite sect, often seen as a close cousin to Turkey's 15m-20m Alevis. The Alevis practise a liberal form of Shia Islam and have long faced discrimination. Although their rituals differ from the Alawites in Syria, they feel some solidarity with them. Mr Van Dam warns that any war against Syria could “further polarise Sunnis and Alevis within Turkey.”

The Syrian crisis has exposed another long-running Turkish sore: its Kurdish minority. Selahattin Demirtas, leader of Turkey's mainly Kurdish Peace and Democracy Party (BDP), insists that Turkey is seeking regime change in Syria “to ensure that the Syrian Kurds don't get any more rights than Turkey is prepared to grant its own Kurds, which is hardly any at all.”

The AK government has done more than any of its predecessors to address Kurdish grievances. It has even conducted secret talks with rebels from the separatist PKK. Last year Mr Davutoglu pressed Mr Assad to be kinder to his Kurds. But the conciliatory mood in Turkey has faded. Thousands of BDP officials have been arrested on dubious charges of PKK membership. AK portrays the crackdown as a response to PKK attacks. Mr Demirtas says it was never sincere about reconciliation.

The PKK considered Syria a mentor until Turkey threatened war against the country in 1998. A frightened Syria booted out the PKK leader, Abdullah Ocalan, who was captured in Kenya and then imprisoned in Turkey. But in those days, pilots in the Israeli air force were allowed to train in Turkish skies. If Israel and Turkey were still friends Mr Assad might feel every bit as shaky as his father did when the Turks last clenched their fists. Then again, if Israel and Turkey were still friends, Turkey might not need to shake its fists at all.