Turkey’s opposition parties have celebrated unexpected success in local elections which saw them outperform President Recep Tayyip Erdogan’s ruling party and add to municipalities gained five years ago.

The main opposition, the centre-left Republican People’s Party, or CHP, kept hold of Istanbul and the capital Ankara by wide margins but also added wins in conservative provinces such as Adiyaman in the south.

The party won in 35 of Turkey’s 81 provinces – including the country’s five most populous cities – while Mr Erdogan’s Islamic-oriented Justice and Development Party, or AKP, took 24.

Crucially, the CHP took 37.7% of the nationwide vote with nearly all the ballots counted. The AKP secured 35.5%.

The surprise results came just 10 months after the opposition was left divided and demoralised following a defeat in last year’s presidential and parliamentary elections.

“It’s a huge turning point,” said Seda Demiralp, a political science professor at Isik University in Istanbul.

“The CHP is no longer the opposition party in local government now… (Erdogan) is clearly aware that throughout Turkey voters sent a clear message, even in conservative cities. It’s unbelievable, it’s a huge deal. It’s not just about local government, it’s about voters saying they’re not happy with the AK Party government.”

Turnout was around 78%, according to the state-run Anadolu Agency, compared to 87% last year. The results suggested that it was mostly AKP supporters who failed to vote, Mr Demiralp said.

Ozgur Unluhisarcikli, director of the German Marshall Fund in Ankara, described the results as unprecedented over Mr Erdogan’s two decades in power.

“We have never seen him lose like this,” he said. “Now the CHP is leading the AKP in the polls for the first time … This is a landslide for the CHP because they got more votes than the AKP for the first time.”

Turkey Local Elections
Two women sit near a campaign banner of Turkish President Recep Tayyip Erdogan (Francisco Seco/AP)

In south-east Turkey, the pro-Kurdish Equality and Democracy Party took 10 provinces while the Erdogan-allied Nationalist Movement Party, or MHP, won eight scattered across the country.

The New Welfare Party, or YRP, which largely competed with the AKP over the support of conservative voters, took two provinces. It was the third biggest party in terms of nationwide votes, taking 6.2%.

The IYI Party and the Great Unity Party won the remaining two provinces.

Following last year’s discouraging defeat, some had expected the opposition to perform poorly in Sunday’s election.

However, a change in leadership in the CHP – from the 75-year-old Kemal Kilicdaroglu to Ozgur Ozel, 49 – appeared to have revitalised the party and paved the way for incumbent CHP mayors and other candidates to secure conclusive victories.

Analysts contrasted the strong candidates fielded by the opposition – such as Ekrem Imamoglu in Istanbul and Mansur Yavas in Ankara – to those standing for the AKP, largely overshadowed by Mr Erdogan during the campaign.

Turkey Local Elections
Istanbul Mayor Ekrem Imamoglu takes photographs with supporters (Francisco Seco/AP)

Mr Imamoglu won by a margin of more than 11 points while Mr Yavas secured a gap of nearly 29 points on his AKP rival. The results are set to boost Mr Imamoglu’s standing as a potential challenger for the presidency in 2028.

“Leadership is becoming more important than parties and ideologies,” Mr Demiralp said. “Especially in a country like Turkey where institutions are weak, people connect to leaders rather than parties and other institutions.”

Sunday’s election came amid an ongoing cost-of-living crisis with voters facing annual inflation that rose to 67% in February. Meanwhile, Mr Erdogan has allowed borrowing costs to rise to 50% in a bid to combat soaring prices.

Commentators said that although the economic crisis left Mr Erdogan’s popularity largely unaffected in last year’s national polls, AKP voters felt more inclined to express discontent when his name was not on the ballot paper.

“The high inflation, hubris, mediocre candidates, a poor electoral campaign, and being outflanked by its former ally – the New Welfare Party – are the main factors behind the AKP’s defeat,” Wolfango Piccoli, the co-president of New York-based consulting firm Teneo, said.