Long simmering behind the scenes, opposition to Turkish President Recep Tayyip Erdogan within his own Justice and Development Party (AKP) has finally exploded into the open following the party's spectacular defeat in last month's repeat Istanbul mayoral election.

But a faultline also appears to have emerged within a cluster of AKP heavyweights once close to the president who are now committed to challenging Erdogan's leadership.

One camp has lined up behind former president Abdullah Gul and Ali Babacan, Erdogan's former economy tsar.

Babacan, who was widely credited with overseeing the economic boom that helped carry the AKP to a succession of election victories, announced his resignation from the party earlier this month.

In a one-page statement, Babacan said Turkey needed a "brand new vision" and a new political movement, and said recent government policies had "created deep differences with my principles, values and thoughts".

"We need to work together and aim to have common sense. We need to begin working on every issue with a blank page. This is why it is impossible to maintain my founding membership of AKP - human rights, freedoms, and rule of law are our indispensable principles," he said.

Erdogan's response to the resignation was terse. "You don't have a right to split the Ummah [the Islamic community]," he told reporters.

All of the president's critics agree the country needs to return to norms of parliamentary democracy, and believe that Erdogan, who has led the party to a succession of election victories since 2002, has lost his famed ability to know what voters want.

It has been long assumed within Turkish political circles that opposition within the AKP to Erdogan would move as a bloc to produce an alternative to the president's current political agenda.

But several sources, both AKP insiders and others outside the party who are close to the dissidents, told Middle East Eye that this isn't the case.

Ahmet Davutoglu, another senior AKP figure who is becoming increasingly vocal in his criticism of Erdogan, now says that he has been frozen out by his former comrades.

"I don't know why we aren't together with Gul and Babacan," Davutoglu told a Sputnik Turkey radio host in a three-hour video interview broadcast on YouTube on Thursday.

Yavuz Oghan, the radio host, said on Friday that he and two colleagues who also featured in the video had subsequently been sacked by the Russian broadcaster.

Abdullah Gul's 'open cheque'

According to MEE's sources, Babacan, 52, is working closely with Gul, a key figure in recent Turkish politics who co-founded the AKP with Erdogan in 2001 and, until recently, was one of his closest political allies.

Gul, now 68, served as president of Turkey from 2007 until 2014, when Erdogan himself became president. He and Babacan are also supported by several other former party heavyweights, including former interior minister Besir Atalay and former justice minister Sadullah Ergin.

"Gul believes Babacan is a vibrant and young politician, who has a lot to offer, especially a clean slate," said a former senior AKP official who is now a member of the Babacan and Gul team.

All the sources interviewed by MEE wanted to speak on condition of anonymity due to the sensitivity of the topic.

"Gul gave an open cheque to Babacan, that he would support his leadership in this endeavour."

Abdullah Gul (2nd L), with Erdogan and their wives attending the opening of the third Bosphorus crossing in Istanbul in 2013 (Reuters)

Gul has been seeking to mount a challenge to Erdogan's leadership for some time. He tried to run as an opposition consensus candidate against his former comrade in last year's presidential election, but Meral Aksener, the leader of the nationalist opposition Iyi party, backed out of the deal at the last minute.

People close to Gul say he now believes the country needs a new individual to spearhead an alternative movement against Erdogan. The conditions are suitable: the trauma caused by the 2016 coup attempt has faded and the recent local election results, in which the AKP also lost control of Ankara and other cities, suggest the public is in need of new faces.

Since December, Babacan had been meeting a wide variety of individuals, from former politicians to investors and academics such as Daron Acemoglu, a renowned economist based at Boston's Massachusetts Institute of Technology, to craft his strategy.

"He doesn't act alone. He doesn't want a political movement based on a leadership cult. He wants equal representation of the founding cadres in the party, involving [a] democratic process to ensure a sound political programme," the source said.

Davutoglu on the outside

However, there is one problem. Another group of conservative politicians led by Davutoglu seems to be excluded from the Gul-Babacan axis.

Those on either side of the divide have different narratives on the reason behind the divergence. But both sides agree that the fundamental disagreement between Gul and Davutoglu goes back to 2014, when Gul's term ended and Erdogan was elected as president.

A source with knowledge of the internal debates within the AKP at the time said the party had conducted a survey in more than 40 provinces, which showed that Gul and Davutoglu were almost equally popular choices to head the party, since Erdogan needed to resign the AKP leadership due to constitutional restrictions.

"The party's executive committee overwhelmingly supported Gul as the new chairman and therefore the new prime minister. However, Erdogan nominated Davutoglu. At the time, there was no other individual who could challenge Gul," the source said.

People close to Gul assert that Davutoglu blocked a natural process by succumbing to political ambitions and in the end was unable to stand up against Erdogan's increasing zest for power.

Erdogan, following the publication on the internet of an unsigned political manifesto - dubbed "Pelican" - that blamed Davutoglu for challenging his leadership, ousted the former prime minister from the party leadership in 2016.

A member of Davutoglu's team challenged this version of events and said Gul had never made clear at the time that he had wanted to come back to party as the new leader.

"Davutoglu actually never asked for the prime ministership. Had Gul demanded the position, he wouldn't have stood in the way," the source said.

Davutoglu, since the beginning of this year, has been increasingly vocal in opposition to Erdogan's leadership. Following March's local elections, he released a 17-page manifesto that severely criticised Erdogan and accused him of failing to meet democratic norms and ideas.

Babacan, who is close to Gul and Davutoglu, made attempts to merge both groups, but failed.

Sources close to Gul allege that the differences stem from two main things. The first is what they describe as Davutoglu's pan-Turkist and Islamist political ideas. Secondly, they criticise his political style, which they suggest mirrors Erdogan's own powerful leadership.

"This is absolutely untrue," the source affiliated with Davutoglu said. "Babacan couldn't convince his friends, including Gul, to include Davutoglu in the new movement. Now they come up with excuses adhering things to him to legitimise their stance."

Babacan and Davutoglu still have friendly relations, yet both sides told MEE that they are unlikely to go forward together.

"The split will likely cost them votes. It doesn't make any sense because one way or another they share the same values and have similar criticisms against the current leadership,” one prominent Turkey expert said, asking for anonymity.

What next?

So what happens next? Sources say Babacan is aiming to establish a party later this year.

"First, we will establish our team and continue to work on our answers to the current crisis the country is facing," the member of the Babacan team said.

The Turkish economy earlier this year slipped into a recession but shows signs of partial improvement. Many shopkeepers last week in Ankara praised Babacan and said they wanted him to run because of his economic credentials.

Babacan, a senior government figure from 2002 to 2015, differed from Erdogan over the former's adherence to the traditional monetarist belief that high interest rates would curb high inflation. Erdogan opposed this view, favouring lower interest rates.

Davutoglu, too, has his own game plan. His supporters believe that he can still wield support among the AKP's voting base in the Anatolian hinterland.

"He will continue to underline his points of criticism against current party policies and will try to convince Erdogan and party members to fix them," a person from the Davutoglu team said.

"If there has to be a split in the end, people would know the reason very well, and understand that there was no other option."

For now, Erdogan, who does not face an electoral challenge until a presidential contest in 2023, does not appear to have a plan to counter the dissenters.

He has not made any changes to his government in the wake of seismic election defeats in March and then June. In speeches, he continues to describe the state of the economy in positive terms and has not made any significant amendments to policies.

Yet he conceded last week that the split with so many former colleagues had shaken him.

"Of course I'm hurt by the likes of [Davutoglu, Babacan and Gul]. How couldn’t I be?" Erdogan told reporters.

This article is available in French on Middle East Eye French edition.