Turkish Prime Minister Recep Tayyip Erdogan is an oddity in modern Turkey: victorious in three consecutive elections and leader of a party that has held an undisputed majority since 2002. Now his seemingly solid grip on power has been shaken as never before, with four of his ministers embroiled in a corruption scandal and Mr. Erdogan engaged in open political warfare with a rival Islamist movement whose influence in and out of Turkey challenges his own.

Three of his top allies – including the ministers of interior and economy – resigned on Wednesday, and hours later Mr. Erdogan announced a major reshuffle to replace 10 cabinet members, including the fourth minister implicated in the graft investigation.

Although few expect the crisis to bring down the government, the inquiry threatens the carefully tended image of the Prime Minister and his party. They have campaigned on an anti-corruption platform, and face local elections in three months. But equally serious for Mr. Erdogan is that the widening scandal is exacerbating divisions inside the ruling Justice and Development Party, or AKP.

Story continues below advertisement

Supporters of the rival Hizmet Islamist movement, led by a U.S.-based Islamist cleric who has been a sometime ally of AKP, are closely integrated within Mr. Erdogan's party, the government and in most state institutions. All this signals a power struggle that could spell trouble ahead for him and for Turkish stability. Analysts say Mr. Erdogan, whose term expires in 2015 and who according to internal AKP rules cannot run again in the next general election, badly needs broad party backing if he is to remain in leadership.

"The reshuffle means practically creating a war cabinet," Hamid Akin Unver, an assistant professor of international relations at Kadir Has University in Istanbul, said in an e-mail after Mr. Erdogan's late-night announcement. The new ministers, he added, were chosen chiefly for their loyalty to Mr. Erdogan. "The war is [about] AKP's political survival and the battle it is going to wage for control."

The political storm broke out with a surprise early morning operation on Dec. 17, when police arrested the sons of three ministers, the mayor of a district that is an AKP bastion in central Istanbul and dozens of others believed to be close to the Prime Minister. They were said to be under investigation for graft, with some accused of participating in an elaborate scheme to bypass international financial sanctions on neighbouring Iran.

Thousands of people took to the streets in the next days, clashing with police and piling shoe boxes in front of bank branches in reference to the millions of dollars of cash reportedly found in shoe boxes in the home of the chief of a major public bank, who was also taken into custody.

Mr. Erdogan has denounced the probe as "a dirty operation" masterminded by a "parallel structure alongside the state" and backed by an "international conspiracy." He has fired or reassigned some 70 high-ranking police officers after the arrests, including Istanbul's powerful police chief. He and his allies have said the investigation is politically motivated – an echo of the complaints of dozens of journalists, academics, army officers and businessmen who have been arrested and accused in recent years of conspiring against the AKP-dominated state.

In response to accusations that he is obstructing the investigation, Mr. Erdogan pointed a finger at the shadowy Hizmet, or Service, network headed by the charismatic U.S.-based Muslim cleric Fethullah Gulen, which has long been rumoured to have strong influence inside the police and the judicial system. Without specifically naming Hizmet, Mr. Erdogan threatened to "break [the] hands" of those who "harm, stir up or set traps in this country."

In turn, Mr. Gulen, who lives in Pennsylvania, issued a recorded message on one of the websites controlled by his movement in which he cursed "those who don't see the thief but go after those trying to catch the thief."

Story continues below advertisement

Until recently, Hizmet and AKP were allies against the political ambitions of the powerful military, but under Mr. Erdogan the military has been brought under civilian control for the first time through constitutional changes. With the common enemy de-fanged – in a closing chapter of that decade-long saga, over 300 high-ranking officers were convicted of plotting against the government in September – an ugly divorce appears to be under way.

"Once financial dealings of ministers' sons become the focus of inquiry, the intensity of the political clash significantly increases," said Prof. Unver. "In Islamism, involving [family members] into a political rivalry is generally seen as hitting below the belt and thus, from now on we will see a very bitter and potentially ugly brawl for power between Turkey's Islamist alliance."

Mr. Erdogan's popularity will be only slightly dented, he added, because he is still seen as effective and personally clean. But "the fallout of the scandal will definitely alter power relations within AKP and will impair Erdogan's popularity within the party ranks over the medium term."

Tensions escalated last month, when the Gulen-affiliated newspaper Zaman reported that the government was preparing to close down private university preparation schools, many of which are affiliated with Hizmet. Gulenist media launched a full scale attack on the government and at least one member of parliament from the ruling AKP who is involved in Hizmet resigned in protest.

"The prep school issue is a very sensitive area for Gulenists," said Prof. Unver, "and that is specifically where Erdogan wanted to hit hard – in order to weaken Gulen to the extent that he can never challenge Erdogan's power or try to infiltrate into the state."

These schools are a major source of income, but also an important power base for Hizmet, which has exercised soft power in Turkey and abroad for decades largely through a world-wide network of schools and media. The movement has mostly taken a passive political stance since the 1970s, accommodating different governments including military regimes, and has instead slowly expanded its power by building networks of moderate Islamists, many of them graduates of its schools.

Story continues below advertisement

Supporters of the schools say they address shortcomings of the state education system and allow high school students who cannot afford to attend a private school to get a shot at enrolling in a good university.

"If you want to close the prep schools, first of all you have to change the public education system," said Onur, 30, an English teacher at the Hizmet-affiliated Dilfem prep school in the Istanbul neighbourhood of Besiktas who declined to have his last name published due to the sensitivity of the issue.

"I have 40 students from different schools here, and none of them speak good English when they come. They get six hours per week in high school, and their teachers never really talk to them in English, teaching them only grammar from outdated textbooks." But critics see the schools as a beachhead for wider Gulen influence.

"[Hizmet] was originally a religious movement interested in promoting education," said Recep Senturk, a professor of sociology and the director of the Alliance of Civilizations Institute at Fatih Sultan Mehmet University in Istanbul. "But gradually it turned into an influential political movement with its own economic and political agenda and interests."

The Hizmet movement's actual strength and reach within Turkish state institutions is not known. Mr. Erdogan is acting as though the Gulen movement has real power in the police force and society, although there is no evidence for that one way or another, said William Hale, a professor emeritus of Turkish politics at the School of Oriental and African Studies in London and who lives and teaches in Istanbul.

But Mr. Erdogan may have placed himself in a difficult position, according to Prof. Hale, speaking before the cabinet reshuffle. "It's all part of the gradual shift in which he seems to have found himself more and more isolated from the rest of the government, and more and more unpredictable, erratic, shooting from the hip, emotional."

Story continues below advertisement

Special to The Globe and Mail