“THEY say the prime minister is harsh. If you call this harshness, I’m sorry—but this Tayyip Erdogan won’t change.” This assertion by Turkey’s prime minister, Recep Tayyip Erdogan, to his ruling Justice and Development (AK) party on June 11th came just as riot police were clashing violently with protesters in Istanbul’s Taksim Square. It left little doubt where the order to clear the square had come from.

Turkey’s turmoil has been going on since May 31st, when the police brutally suppressed a peaceful protest by a group camped in Gezi Park on the edge of Taksim. Had Mr Erdogan backed away earlier from his controversial plan to build a shopping arcade and residential complex over the park, the protests might swiftly have died. Instead an obdurate prime minister has spewed out incendiary rhetoric that sparked anger among the tens of thousands of mostly young people taking to the streets across the country to show solidarity with Taksim. Only on June 12th did Mr Erdogan soften a bit, suggesting that his plan for Gezi Park might be put to a referendum in Istanbul.

Critics are saying that Mr Erdogan has wrested power from Turkey’s once meddlesome army only to hand it to the police. Even his allies are starting to doubt if, despite still being Turkey’s most popular politician, he is any longer fit to lead. Scenes of police brutality have besmirched the image of a country long hailed as a role model for the Muslim world. “Erdogan looks increasingly like Hosni Mubarak before his fall,” comments Kerem Oktem, an Oxford academic who studies Turkey.

There was a moment of hope when Mr Erdogan met protesters on June 12th, after which he touted the referendum idea. But it jarred against the huge police crackdown on the square a day before the meeting took place. Left-wing radicals who have tried to hijack the greens’ cause were occupying the square, draping giant banners over the Taksim monument and surrounding buildings in open defiance of the government’s authority. Burnt-out vans and long stretches of walls had been plastered with rude graffiti like “From Turkey to Greece, Fuck the Police”.

When the police asked the protesters to disperse, a band of provocateurs began hurling Molotov cocktails and stones. The response came with water cannons and tear gas, in some cases canisters fired straight at people. Despite pledges by Istanbul’s governor that Gezi Park would not be touched, the police began dousing it too.

In an ominous turn, Mr Erdogan declared that the park must be evacuated within 24 hours or it would be cleared by force. Turkey’s American and European friends have been calling increasingly loudly for restraint. Yet Mr Erdogan still seems bent on confrontation. Not only does he belittle the protesters as hoodlums and drunks (he even suggested they had drunk beer and copulated in an Ottoman-era mosque) but he has turned his ire on the foreign press—two Canadian journalists were briefly arrested. In his mind “exaggerated” reports of the events in Taksim Square are part of a global conspiracy by foreign powers who are stirring up trouble to drive up Turkey’s borrowing costs. This will supposedly bring down the economy, and with it Mr Erdogan. Pro-government titles are awash with stories of the roles played by Israel and the Jews. The problem, says an AK insider, “is that the prime minister believes this stuff.”

In truth the protesters defy labels. There are greens, gays, anarchists, Kurds, Alevis and lots of women. Nearly all are fed up with Mr Erdogan’s efforts to impose his social conservatism on the country, with little regard for the half of the Turkish electorate that has never voted for AK. “They are the first generation to take to the streets for individual liberties rather than collective rights,” comments Aykan Erdemir, a member of parliament for the main opposition secular Republican People’s Party (CHP).

Mr Erdogan’s pugilistic style has served him well in his previous battles against the army and the judiciary. Over the past week he has also cloaked himself in martyrdom with rousing speeches about the persecution of the pious by Turkey’s erstwhile secular rulers. Jenny White, an anthropologist at Boston University and an expert on Turkey, argues that “those who think he has lost his cool and is reacting blindly may find that this crackdown is Erdogan’s pragmatic strategy to shut down the protests once and for all.”

But can it work? One big reason for Mr Erdogan’s enduring popularity is his successful management of the economy. His polarising tactics may rally his base, but they appear to be spooking investors at a time when the economic outlook had already darkened (see article). And behind his bravado is a worry about the future.

Mr Erdogan wants to be elected as Turkey’s president when the post comes up in August 2014. Until the Taksim troubles he seemed certain to get the job. Now Abdullah Gul, the incumbent and a co-founder of AK, may feel emboldened to run for a second term instead. His conciliatory manner during the crisis has raised his stock. But, ever the Muslim as well as the democrat, Mr Gul has signed into law Mr Erdogan’s controversial new bill to restrict the sale and consumption of alcohol.

Much will depend on the municipal elections due to be held next March. Should AK do poorly, some party members may turn to Mr Gul. Either way, it seems increasingly unlikely that Mr Erdogan will move forward with the new constitution that he has long promised. This may jeopardise his peace talks with the Kurds, who want a revised constitution to recognise their rights. The threat of a spillover from the conflict in Syria is also still a worry. Many Turks blame Mr Erdogan’s overt support for Syrian rebels for the twin car-bomb attack that claimed 52 lives in the border city of Reyhanli last month.

Behind the macho posturing, some detect a hint of panic in Mr Erdogan, which could yet make the situation worse. Why is he planning separate rallies in Istanbul and Ankara this weekend? And what message will he deliver? When supporters greeted Mr Erdogan on his return from north Africa on June 6th, they chanted “let’s crush Taksim” and “minority don’t test our patience”. As Ms White warns, “if Erdogan puts a club in their hands and points the way, they will become like the thugs that appeared in Tahrir Square.”