Update 2: Chaos erupted late on Sunday when President Erdogan's ruling AKP party was looking certain to lose control of the capital, Ankara, while both AKP and the opposition CHP party claimed victory in Istanbul in the culmination of a critical municipal vote that is testing the popularity of Turkey's executive president.

As reported by various news wires, preliminary results showed the opposition flipping the capital Ankara and surrounding areas from Erdogan’s alliance, and taking control of some of Turkey's key Mediterranean coastal cities. In a stunning (or perhaps not, after all this is Turkey) to what appears to be an extreme close vote, even before the final figures were announced, Erdogan’s ally and former prime minister Binali Yildirim said he won the race in Istanbul, Turkey’s commercial hub, a claim rejected by the opposition, which said it won.

TURKEY'S BINALI YILDIRIM SAYS HE WON THE RACE IN ISTANBUL

TURKEY OPPOSITION'S KILICDAROGLU SAYS WON IN ISTANBUL

When Yildirim declared victory, the state-run news agency reported a margin of less than 0.1 percentage point between him and his main rival Ekrem Imamoglu. That means that out of some 10 million ballots cast in the city, the difference was about 5,000 votes according to Bloomberg. Adding to the confusion, and calls that Erdogan has stolen the election, when Yildirim spoke, the state-run news agency showed 98.8 percent of votes tallied, and then stopped reporting updated results for Istanbul after he declared victory. The opposition candidate said the result was manipulated and the party’s leader also claimed victory in televised remarks.

Contrary to expectations for an imminent rout now that elections are out of the way, the Turkish lira was little changed at least in early trading after midnight in Istanbul, although the highly volatile currency is expected to move substantially in the next few hours.

“Turkey’s regime now signals that it won’t give up Istanbul, regardless of vote distribution,” Timur Kuran, professor of economics and political science at Duke University, said on Twitter. It’s the “clearest sign yet that Team Erdogan knows it actually lost Turkey’s biggest city.”

Despite losing Ankara and perhaps Istanbul, Erdogan's support at the national level was solid, with Erdogan’s AK Party-led alliance receiving 51.7% of the national vote, with 91% of the ballot boxes opened, state-run Anadolu Agency reported. The opposing camp led by the Republican People’s Party, or CHP, had 37.6% while the pro-Kurdish HDP, which is sitting out the races outsides its stronghold in Turkey’s eastern regions, garnered 4%.

Despite the majority vote for Erdogan's AKP, the opposition claims that shrinking support for Erdogan would mark the beginning of the end of his 16-year rule. The Turkish leader was sworn in with almost untrammeled powers after last year’s general elections that followed a 2017 constitutional amendment to change Turkey’s political framework into an executive presidency from a parliamentary system.

* * *

Update 1: it appears that things are back to normal in Turkey, where despite polls showing a possible loss for AKP candidates in Istanbul and Ankara, Erdogan's ruling party is said to be on top, and according to Turkish NTV broadcaster, the AKP candidates were leading mayoral elections in Turkey’s two main cities after about one quarter of ballots had been opened.

It said the AKP candidate in Istanbul, the country’s largest city, had 51.8 percent with 24.4 percent of ballot boxes opened. The main opposition Republican People’s Party (CHP) candidate had 45.8 percent. The AKP was also leading in the capital Ankara with 51.6 percent of votes after 22.5 percent of ballots were opened, NTV said.

* * *

The moment of truth for Turkey's executive president and currency manipulator-in-chief has arrived.

Turks are voting on Sunday in local elections which President Tayyip Erdogan has described as a matter of survival for Turkey and which were marred by lethal violence that left two party members dead in the country’s southeast.

While Erdogan, who last June won a presidential election which further cemented his rule by gaining executive powers, has become the country’s most popular, yet also most divisive, modern leader, he could be dealt an electoral blow with polls indicating his ruling AK Party (AKP) may lose control of the capital Ankara, and even Istanbul, the country’s largest city according to Reuters.

Erdogan exits a polling station during the municipal elections in Istanbul, Turkey, March 31

And with the stagflating economy in a deep recession following a currency crisis last year which saw the lira lose more than 30% of its value, some voters appeared ready to punish Erdogan, who has ruled with an increasingly uncompromising stance.

“I was actually not going to vote today, but when I saw how much they (AKP) were flailing, I thought this might be time to land them a blow. Everyone is unhappy. Everyone is struggling,” said 47-year-old Hakan after voting in Ankara.

The polling stations closed at 4 p.m. local time in eastern Turkey and an hour later in the rest of the country. While early indications from preliminary vote counts were expected two or three hours after voting closed, though a clear picture would take longer especially if the voting process is rigged, as some have warned may happen.

Ahead of the election, the lira once again tumbled forcing the central bank to briefly hike the overnight swap rate to a ludicrous 1300% and force a short squeeze; however with the elections now over, many expect the currency's free fall will resume apace as Turkey's economic woes and runaway inflation are only getting worse. Last week Erdogan blamed the country’s economic woes on attacks by the West, saying Turkey would overcome its troubles and adding he was “the boss” of the economy.

“The aim behind the increasing attacks towards our country ahead of the elections is to block the road of the big, strong Turkey,” Erdogan told a rally in Istanbul on Saturday.

Sunday’s elections, in which Turks vote for mayors and other local officials across the country, are the first since Erdogan assumed sweeping presidential powers last year and will be a reckoning for his government, which has come under fire for its economic policies and record on human rights.

Meanwhile, as on prior elections, Sunday's vote was marred by violence in the southeast and Istanbul where two members of the small Islamist Felicity Party, a polling station official and an election observer, were shot dead in Malatya province, a party spokesman said. Media reports said one person had been detained. After voting in Istanbul, Erdogan said he was saddened by the incident and that it was being thoroughly investigated. Some 553,000 police and security force members were on duty for the vote nationwide.

Elsewhere, two people were hurt in the town of Diyarbakir, after being stabbed in a dispute between candidates, a hospital source told Reuters, while dozens of people were hurt in other election-related clashes in the southeast.

One person was stabbed as 15 people clashed in a row between candidates in Istanbul’s Kadikoy district, a police source said.

* * *

With all eyes now on the results, defeat in Ankara or Istanbul would end nearly a quarter of a century of rule by Erdogan’s AKP or its predecessors in Turkeys' two most important cities and deal a symbolic blow to Turkey’s leader; it is unclear if such a result would prompt Erdogan to become less confrontational or seek to further tighten his grasp on control.

Ahead of the vote, the main opposition Republican People’s Party (CHP) and Iyi (Good) Party formed an electoral alliance to rival that of the AKP and its nationalist MHP partners. The pro-Kurdish opposition Peoples Democratic Party (HDP), which Erdogan has accused of links to Kurdish militants, is not fielding candidates for mayor in Istanbul or Ankara, which is likely to benefit the CHP.

“Before, this city did not have the services I have now seen. I gave my vote to the AK Party for services to continue,” said tradesman Haci Ahmet Beyaz, 43.

In typical fashion, in the days leading up to the vote Erdogan held over 100 rallies across the country and blasted his rivals as terrorist supporters and warned that if the opposition candidate wins in Ankara, residents would “pay a price”. His opponents have denied the accusations and challenged his characterisation of the elections as a matter of survival.

“We’re electing mayors. What does this have to do with the country’s survival?” Kemal Kilicdaroglu, head of the CHP, told a rally in Eskisehir.

We will bring you the election results as soon as they are released.