Police detained the sons of three of his cabinet ministers, a construction tycoon, and a mayor from his party in dawn raids

IT WAS one of the most audacious challenges ever to the rule of Recep Tayyip Erdogan (pictured), the Turkish prime minister. On December 17th police detained the sons of three of his cabinet ministers, a construction tycoon, and a mayor from his mildly Islamist Justice and Development (AK) party in dawn raids carried out in Istanbul and Ankara as part of a corruption probe. News of the detentions of around 49 people sent shockwaves throughout the political establishment and the Istanbul Stock Exchange’s main index fell by more than 2% amid news that the investigation had extended to a state-run lender, Halkbank.

The operation is seen as a further and dramatic escalation in the continuing power struggle between Mr Erdogan and Turkey’s most influential cleric, Fethullah Gulen, who commands a global empire of media outlets, schools and charities from self-imposed exile in rural Pennsylvania.

The day before, Hakan Sukur, a former footballer who was elected to parliament on the AK ticket in the 2011 elections, resigned from his party over what he called its ingratitude towards Mr Gulen. Might other defections ensue? Mr Erdogan must surely be wondering. Turkey’s beleaguered secularists are rubbing their hands in glee.

Yet, in his first comments after the detentions Mr Erdogan struck a characteristically defiant note: “We will not bow to any threats. They can resort to whatever ugly methods and alliances they choose…the AK party government will not allow this,” he said. Mr Erdogan also pointed a finger at the same “dark foreign forces” whom he claimed had orchestrated the mass anti-government protests in June. “Turkey is not a banana republic,” he roared.

The row between Mr Gulen and Mr Erdogan who is also a professionally trained Muslim cleric or imam, had been brewing for some time. Mr Erdogan has accused Mr Gulen’s followers of establishing “a parallel state” by "infiltrating" key government ministries, the judiciary and the police force. “They are like ghosts, they are everywhere and nowhere,” said Ahmet Sik, a journalist who spent a year in jail after writing a book about Mr Gulen’s alleged grip over the state.

The so-called Gulenists are accused of exploiting their influence to gather incriminating evidence against the AK party members. The Gulenists dismiss the claims as “black propaganda” casting themselves as democrats alarmed by Mr Erdogan’s drift towards authoritarian rule. It recently emerged that AK had been spying on the Gulenists as well. Tax auditors are now said to be preparing to swoop in on Gulen-affiliated businesses including Bank Aysa, an Islamic finance house. Many fret that the assorted dirt will spill out before nationwide municipal elections that are due to be held in March. The elections will be a crucial measure of Mr Erdogan’s popularity as he prepares to run for the presidency that will come free next August

Ironically, when AK shot to power in 2002, the Gulenists were its closest allies in the battle to declaw the army. Pro-Gulenists prosecutors were seen as the driving force in the controversial Ergenekon case which led to the convictions of hundreds of generals and their allies on coup-plotting charges. The defence insists that the case rests on fabricated evidence.

The coalition between AK and the Gulenists is said to have crumbled after Mr Erdogan resisted their attempts to infiltrate the country’s national spy agency as well. Last month he prepared to deal the movement a crippling blow when he announced plans to phase out thousands of crammers schools that prepare students for university exams. Many are owned by the Gulenists and serve as a big source of cash and potential recruits.

Recent opinion polls suggest that Mr Erdogan continues to command around 50% of the vote. “As usual Erdogan will use the raids to play the victim,” predicts Levent Gultekin, a pundit. This might prove harder should the corruption charges stick. Yet, as Mr Erdogan himself declared, it is the ballot box that will reveal his true strength.