Adem Altan / AFP / Getty Images Turkish Prime Minister Tayyip Erdogan is applauded by members of parliament from his ruling Justice and Development Party (AKP) during a meeting at the Turkish parliament in Ankara June 25, 2013.

Both were religious men. In the early 1970s, Cemal Usak and Recep Tayyip Erdogan were classmates at the Istanbul Imam Hatip Lisesi, an Islamic high school. By the end of the decade, their career paths had begun, ever so slightly, to diverge. “I was coming from what you would call a tradition of cultural Islam,” says Usak. “He opted for political Islam”. Still, he says, the pair remained close.

Today, forty years removed from his high school days, Usak is a leading figure in Turkey’s largest Islamic movement, the Gulen community. Erdogan, meanwhile, is the country’s Prime Minister and by far the most powerful man in the land, if not the entire region. Usak still counts the Turkish leader as a personal friend, but the alliance between the groups that each man represents – and which helped bring Erdogan to power – is fast unraveling. For the first time in years, the glue that binds Erdogan’s ruling Justice and Development Party (AKP) is being put to the test.

To Turks and outside observers alike, Usak’s movement remains something of a puzzle. Its leader, Fethullah Gulen, a septuagenarian preacher, resides in a sprawling estate in Saylorsburg, Pennsylvania. Its followers, said to number in the millions in Turkey alone, preach a feel-good gospel of tolerance, almsgiving and education, which they feel is intrinsic to Islam. Their preferred activities, at least those advertised publicly, include running hundreds of schools across the world, organizing humanitarian assistance, and engaging other religious groups in inter-faith dialogue.

(MORE: ‘Turkish Betrayal’ Is the Talk of Israel)

The movement’s leading lights insist that it has no political agenda to speak of. Critics find this laughable. Over the years, they say, the Gulenists have accumulated and exercised considerable power in Turkey, rising to positions of influence inside the civil service, the media and the business community. The movement, some of them say, has become a state within a state.

Formerly one of Erdogan’s most stalwart allies, the Gulen community has recently become a major thorn in the Prime Minister’s side. Last year, prosecutors said to be close to the movement tried to subpoena his intelligence chief. This year, media organs run by its followers criticized his clumsy handling of the Gezi Park protests. Finally, prominent Gulenists have taken the Prime Minister to task for his government’s restrictions on press freedoms, policies towards the Middle East, and the post-Gezi crackdown.

Erdogan has now decided to hit the Gulenists where it hurts. In mid-November, the prime minister announced that he would close down the country’s private exam prep schools, or dershanes, roughly a quarter of which are run by Gulen’s followers. The schools, he said, are perpetuating social inequalities between those who can and cannot afford them, creating a parallel system of education. The government has since moderated its tone, emphasizing that dershanes would be allowed to operate until 2015, at which point they would be “transformed” into private schools.

For young Turks, the dershanes are a necessary fact of life, offering hours of daily tutoring for the tortuous high school and college entrance exams, both of which, given the amount of stress and cramming involved, make the SATs seem like a pop quiz. For the Gulenists, the schools are also a major source of financial revenue and a way to attract young followers. The decision to close them, they say, is an attack on private enterprise. Usak himself acknowledges that the dershane system might be an anomaly, but it’s the flawed educational system that needs fixing first, he says, and not its byproduct.

(MORE: Amid Explosions and Clashes, Volatile Turkey-Syria Border Gets More Dangerous)

With the controversy in full swing, the Gulenists and the Erdogan faithful, once wary of allowing tensions between them to boil over, are now trading blows on an almost daily basis. The movement’s leader, Fethullah Gulen, known for speaking in abstruse parables, has resorted to ones that are less difficult to decipher. “If people concerned with mundane interests in every realm are against you, if the Pharaoh is against you, if Croesus is against you, then you are walking on the right path,” he told supporters in a statement posted online, almost certainly likening Erdogan to ancient, tyrannical potentates.

The latest bombshell landed last week, when a Turkish newspaper leaked a 2004 document in which Erdogan’s government and the top army brass signed off on a decision to go after the Gulen movement and its interests. (The movement is said to boast several million supporters, many of them in influential positions.) AKP officials do not deny the document’s authenticity. They insist, however, that the decision, signed at a time when the generals still breathed down the government’s neck, never entered into force.

They might have a point. For much of the past decade, the Gulen movement appeared to be working hand-in-glove with the AKP, much to its own benefit. Its sympathizers filled key positions in the bureaucracy. Its newspapers cheered the prime minister through thick and thin. Gulen followers also found plenty of common ground with the government during a series of controversial coup trials that eventually landed many of Turkey’s top military officials behind bars. The trials not only neutralized Turkey’s meddlesome army as a force in domestic politics, critics say, but also allowed the Gulenists and the AKP to silence a handful of outspoken critics.

Even if the movement’s marriage of convenience with Erdogan had recently been on the rocks, why the Prime Minister should file for divorce just months ahead of local elections remains anyone’s guess. “Mr. Erdogan feels that has the power to do whatever he wants, to control everything in the country,” says Sahin Alpay, a lecturer at Istanbul’s Bahcesehir University. Perhaps, he says, having won nearly 50 percent of the vote in 2011, having brought the army to heel, and having made some inroads with Turkey’s Kurdish minority, “Erdogan does not care whether the Gulen movement will oppose him or not.”

Even so, the AKP’s polling numbers aren’t expected to budge significantly, at least in the short term. Continued economic growth, though down from 2010 and 2011 when it approached double digits, is one reason. Another is that with the opposition unable to mount a credible challenge to Erdogan, AKP supporters upset with the government’s reaction to the Gezi Park protests and its handling of the dershane issue have practically nowhere to turn. “As long as the AKP performs to satisfy the economic and social wishes of its constituency, Turkish voters are not going to look for an alternative,” says Atilla Yesilada, an Istanbul-based political analyst with Global Source Partners. Some might vote for the nationalists, he says, and some might turn to the social democrats, but overall “there aren’t too many addresses that could accommodate them.”

The same goes for the Gulenists. For all its recent criticism of Erdogan’s government, the movement can ill afford to jump ship. “It has nowhere to go politically,” says Joshua Hendrick, a professor at Loyola University Maryland. The ruling party, he says, is its only home. “There is no opposition that can create and implement policies that are as favorable to the movement’s political interests.”

The Gulenists’ only available recourse, Hendrick says, is to try to reshape the AKP. They appear to have started already – mainly by championing the only man capable of mounting a challenge to Erdogan—Turkish President Abdullah Gul.

Erdogan, who has promised to stand down as Prime Minister at the end of his current third term, is said to have his eyes on the presidency, which he hopes to use to continue steering the ship of state. Gul, who has hinted at running for reelection, appears to be the only man in his way. He may, of course, make way for Erdogan, but in exchange for becoming prime minister. However he positions himself, the sitting president, who projects the image of a much more conciliatory, inclusive leader, can count on the Gulenists’ backing. “There is very vocal support for Gul inside the movement,” says Hendrick. “They are strongly pushing for him to take up the mantle.”

Usak, though guardedly, appears to acknowledge that the movement’s main grudge is not with the AKP, but with Erdogan. “He seems too overconfident compared to his previous terms,” he says of Erdogan, so much so “that he does not even discuss the issues with his own team.” It remains to be seen how much Erdogan’s team will suffer from losing the loyalty of Usak’s movement.

MORE: From Atatürk to Erdogan — TIME Covers Turkey