ISTANBUL (AP) — Turkey's opposition looked poised to win control of the country's two biggest cities Monday as it dealt President Recep Tayyip Erdogan's conservative party one of its most serious electoral setbacks in years. The opposition won Ankara, a ruling party stronghold for decades, and was leading a tight race for mayor in Istanbul, according to unofficial figures Monday.
The leader who has dominated Turkish politics for 16 years declared victory despite the opposition gains.
Sunday's local elections were widely seen as a gauge of support for Erdogan as the nation of 81 million faces a daunting economic recession. They were also a first test for Erdogan — who has been accused of increasingly authoritarian tendencies — since he got widely expanded presidential powers last year.
If confirmed, the swings in Ankara and Istanbul could be excruciating for the politician who campaigned hard to retain hold of them. The opposition also retained its hold over Izmir, Turkey's third-largest city.
Although Erdogan was not running for office Sunday, he became the face of the campaign, rallying tirelessly for months across Turkey, using hostile rhetoric against opposition parties and portraying the vote as a matter of national survival.
The decline in urban support for his conservative, religious-based party came despite the fact that Erdogan wields tight control over the media, which hardly covered the opposition candidates' campaigns.
Behlul Ozkan, an associate professor at Marmara University, said Erdogan's loss of ground in Ankara and Istanbul indicated that his socially conservative and construction-driven policies no longer resonated in Turkey's cities.
"Political Islam's quarter-century old hegemony in Turkey's two largest cities is over," he said. "The basic problem is that Erdogan is not able to get votes from middle-income earners, who believe that the economy, education and urban administration are not run well."
More than 57 million voters were eligible to choose leaders for 30 major cities, 51 provincial capitals and 922 districts in Turkey, as well as thousands of local positions. The election was marred by sporadic violence, with five dead and scores injured across Turkey.
Erdogan's party and its nationalist allies garnered some 52% of the vote overall but the opposition made momentous inroads.
A strategic decision by a pro-Kurdish party to sit out critical races in major cities contributed to the opposition's gains. The opposition also increased its support along the Mediterranean, taking the city of Adana from the nationalists and the resort destination of Antalya from the ruling party.
Erdogan acknowledged setbacks in a speech to his supporters, saying his party would work to understand what had gone wrong and fix the problem.
Unofficial results reported by the state-run Anadolu news agency after all votes were counted showed a razor-thin win for the opposition in the race for mayor of Istanbul, Turkey's largest city and commercial hub. The opposition vote was at 48.8% support to the ruling party's 48.5% support.
Ekrem Imamoglu, the opposition candidate in an alliance led by the secular Republican People's Party, or CHP, declared that he won Istanbul but his rival, former Prime Minister Binali Yildirim of the ruling party, said it was still too early to call.
Yildirim accepted that his rival was leading but said his party would file an objection, suggesting a recount of the 319,500 votes declared void in Istanbul.
Both Ankara and Istanbul have been held by Erdogan's Justice and Development Party, the AKP, and its Islamic-oriented predecessor for 25 years. Erdogan's own ascent to power began as Istanbul mayor in 1994.
Unofficial results showed Mansur Yavas, the candidate of the CHP-led alliance, winning the top post in Ankara with 50.9% support. The AKP still holds a majority of Ankara's 25 districts. The government had accused Yavas of forgery and tax evasion, which he called slanderous.
The AKP's candidate for Ankara mayor, Mehmet Ozhaseki, won 47.1% support and his party said it would challenge the results.
Sunday's election was a significant victory for the opposition, which displayed good strategies and promising candidates, said Ozgur Unluhisarcikli, the Ankara director of the German Marshall Fund.
"This will certainly lead to an emerging new political landscape in Turkey," he said.
He argued, however, that a pause in elections until 2023 would benefit Erdogan.
"This gives the governing party and President Erdogan a window of opportunity to undertake economic reforms, political reforms if they wish, fix Turkey's relations with foreign countries," he said.
Andrew Dawson, head of the Council of Europe's election observation mission, said Monday his monitors were "not fully convinced that Turkey currently has the free and fair electoral environment which is necessary for genuinely democratic elections."
In predominantly Kurdish provinces, the Peoples' Democratic Party, or HDP, won back some seats from government-appointed trustees, including the symbolic capital of Diyarbakir, but lost several former strongholds to the ruling party.
The government has replaced 95 elected officials since 2016 for alleged links to outlawed Kurdish militants.
Dawson urged the Turkish government to respect the election results.
Political parties have three days to submit objections and official results are expected in the coming days.