ISTANBUL—In the summer of 2001, Recep Tayyip Erdoğan, a charismatic former mayor of Istanbul, promised to transform Turkish politics. “The period of ego-centered politics is over,” he said, announcing the founding of the Justice and Development Party (AKP). “We will not obey nor idolize anyone. A team will administer the party. The leader will not overshadow it. Those who come by election will go by election.”

These promises carry a dark sense of irony today. A party built on grassroots mobilization and local governance is controlled by those at the top. Foreign investors who helped fuel years of unprecedented economic growth are cowed by the erosion of independent institutions. Critics of the government are detained late at night over a tweet insulting the president. Yet one pledge—to the supremacy of the popular will—had long remained largely intact. Ever since 2002, the AKP’s power has, above all, been based on an undeniable fact: It just kept winning elections.

Now this fundamental principle, too, may be at stake. Following local elections last month, the AKP challenged results in several cities where it did not win a majority. In Istanbul, it pushed for a recount that dragged on for more than two weeks. Just before the opposition candidate Ekrem Imamoğlu was eventually declared mayor, the AKP filed a request to invalidate the outcome of the election and rerun the vote, on which the Supreme Electoral Council is expected to decide soon.

These moves have brought already existing divisions and discontent within the AKP to a boiling point. For years, members of the party have privately complained about their frustrations and worries, but only when nobody could hear them. Shocked by recent events, some have now decided to speak out, offering a rare glimpse into a party that seems to have forgotten what it once stood for. Pushing for a cancellation of the election, these internal critics warn, would harm not just Turkish democracy, but the future of their own party as well.

“I am voicing criticism because others are not,” Kemal Öztürk, a former spokesman for Erdoğan who also served as the head of Turkey’s state news agency Anadolu from 2011 to 2014, told me. “I am a member of the AKP and want it to stay in power. But for that to happen, the party should constantly renew itself.”

Öztürk said structural problems have beset the AKP in recent years, since it embarked on a more nationalist course. This mounting nationalism reflected a global trend, he said, adding that it was in part a reaction to what were perceived as anti-Turkish sentiments in the West. As relations with Europe soured, many liberals left the party, and its commitment to meritocratic principles dwindled.

According to Galip Dalay, a visiting scholar at Oxford University, experienced politicians have, as a result, been replaced by Erdoğan’s personal confidants. “President Erdoğan values loyalty above everything else,” Dalay told me. “This has promoted a politics of favoritism and the rise of a class of careerists. These figures put their own interests above everything else and fuel personal rivalries within the party.”

Four sources with ties within the AKP, all of whom requested anonymity out of fear of reprisals, in particular expressed concerns about the growing influence of Erdoğan’s son-in-law Berat Albayrak, who was appointed finance minister last year. The election loss in Istanbul, these sources said, was at least partly related to a power struggle between Albayrak and the AKP’s candidate for mayor, Binali Yıldırım. According to one of the sources, a former political adviser still in touch with the party leadership, the two clashed as Albayrak demanded to maintain his influence in the future management of the city, which undermined Yıldırım’s already lackluster campaign.

The infighting is tied in large part to the enormous financial interests at stake. The budget of Istanbul’s Metropolitan Municipality amounted to 42.6 billion Turkish lira ($7.3 billion) last year, higher than that of most national ministries. A large proportion of this money goes to private companies to which the municipality outsources the provision of services or infrastructure projects. Controlling Istanbul therefore means presiding over a huge network of nepotistic relations that have increasingly become the oil that keeps the AKP’s power machine going. The Albayrak family has invested in these relations since the mid-1990s, when Erdoğan was mayor of Istanbul and outsourced municipal projects to Albayrak Holding, a Turkish conglomerate that has taken on large construction and infrastructure projects ever since.

It seems no coincidence, then, that media outlets managed by members and business partners of the Albayrak family, such as Sabah and A Haber, were quick to discredit the election results, accusing the opposition of “theft” at the ballot box. Erdoğan himself initially responded in milder fashion, calling on all parties to respect an ongoing recount in several districts, but when it became clear that doing so would not change the result, he too claimed that the election was marred by “organized crime.”

Given the narrow margin of the opposition’s victory, the AKP’s initial request for a recount was understandable. Yet according to Osman Can, a former judge-rapporteur at Turkey’s Constitutional Court and onetime member of the AKP’s board, the party failed to deliver sufficient evidence for irregularities and violated the time frame within which a recount can take place. “The whole process was unconstitutional,” Can told me.

Abdullah Gül, a co-founder of the AKP and a former Turkish president, also condemned the government’s handling of the recount, which he said “cast a shadow over our democracy.” His statement gave support to long-running speculation that onetime AKP heavyweights were preparing a new splinter party. A potential leader of such a breakaway faction would be Ahmet Davutoğlu, a former prime minister. One of the sources I spoke to, citing a recent conversation with Davutoğlu, told me that the politician was planning to make such a move in the coming months, but had struggled to join forces with Gül because of personal rivalries. Davutoğlu’s frustration was apparent in a lengthy post on his Facebook page, in which he lamented the AKP’s losses in last month’s local elections and criticized “a circle which considers itself to be above our party’s governing bodies and tries to run it like a parallel structure.”

Öztürk said he believed new political movements would take shape this year, but doubted Gül or Davutoğlu would enjoy much public appeal. He instead expressed concerns over the rising star of Istanbul’s new mayor-elect, Imamoğlu, who, unlike his own secularist Republican People’s Party, has managed to reach out to AKP voters by promising inclusiveness and accountability—much like Erdoğan once did himself. Efforts to discredit Imamoğlu’s victory, Öztürk argued, have only increased his popularity: “He was just going to become a mayor. Now he became a leader.”

Critics of the AKP’s strategy therefore fear that a rerun would only make matters worse for the party. One source, the former political adviser, said that the party not only would struggle to increase its share of the vote, but also could face even greater economic unrest. With youth unemployment at more than 25 percent, a currency in decline, and high levels of inflation, he said that the last thing financial markets needed was a new election period.

The Supreme Electoral Council now faces a momentous decision. “If it goes on to cancel this election, it would destroy its credibility altogether,” said Can, the former judge-rapporteur. “People would lose their trust [in] elections, which would be an absolute turning point in the history of Turkish democracy.”

The electoral council is under “great political pressure,” Can told me, but he said he nevertheless expected that the AKP had by now realized the risk of a rerun. Indeed, there are some signs that Erdoğan himself has begun to change his tune. In a statement that contrasted with his previous attacks on the election results, the president on Friday said that “it’s time to shake hands” and refocus on improving the economy and security.

The former mayor of Istanbul understands like no other what this might entail for his future grip on power. “If we lose Istanbul, we lose Turkey,” Erdoğan is reported to have said. Turkish electoral history teaches that control over municipalities is the key to success in subsequent national elections. Above all, voters demand efficient local services and economic benefits, the two cornerstones of the AKP’s own success.

The only way to win the national elections in 2023, Öztürk argues, is to respect the foundational promises Erdoğan made back in 2001. “The AKP must return to its default settings,” he said, not without a sense of nostalgia. “Being in the field, hearing the voice of the streets. That’s how it used to be.”

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.

Melvyn Ingleby is a journalist based in Istanbul and is a research associate at the French Institute of Anatolian Studies in Istanbul.