Turkish President Recep Tayyip Erdogan, alongside his wife, Emine, addresses supporters in Ankara on Monday. (Photo: AKP)

(CNSNews.com) – Turkish President Recep Tayyip Erdogan and state media put a brave face on local election results Monday, but his Islamist party sustained a severe blow when it lost control of the capital Ankara to its secularist rival – which also looked set to swing the country’s biggest prize, Istanbul.

For the first time in 25 years, Ankara (pop: 4.6 million) will no longer be administered by Erdogan’s Justice and Development Party (AKP) or its Islamist precursors, but by the opposition Republican People's Party (CHP), whose candidate won by less than half a percentage point. (The AKP is contesting the outcome, alleging “invalid votes and irregularities.)

The CHP also retained control over Turkey’s third-largest city, Izmir (pop: 2.8 million).

But in Istanbul (pop. 14 million), the picture looked even more troubling for the AKP. Although the final result is in the hands of the country’s Supreme Election Board, the CHP candidate currently leads by some 25,000 votes, with more than 99 percent of ballots taken into account.

Erdogan was Istanbul’s mayor from 1994-1998, and the loss of Turkey’s biggest and most historic city, also after 25 years, would be a particular blow to the autocratic president.

Erdogan effectively made the local elections a personal referendum, and characterized them as a matter of the very “survival” of the party and country, which has been weathering an economic crisis.

Nonetheless, he is highlighting the fact the AKP candidates won 44.3 percent of the vote compared to the CHP’s 30.1 percent. The alliance of AKP and Nationalist Movement Party (MHP) together took more than 51 percent of the vote nationwide.

Erdogan has been in power, first as prime minister then as president, for 16 years, and has become accustomed to winning elections.

Addressing supporters from the balcony of AKP headquarters in Ankara, he stressed that the AKP has won 15 consecutive national elections, and thanked voters for “showing sensitivity toward the issue of survival,” the state-run Anadolu news agency reported.

Acknowledging the loss of some important cities, he said that, “As of tomorrow morning, we will start finding and making up for our shortcomings.”

Noting that Turkey will now not hold another election for more than four years, he said he will now “focus on national and international issues, and hopefully raise our country above the level of our contemporaries.”

That next election is in 2023, a significant year for Turkey since it marks the 100th anniversary of its founding by Ataturk.

Despite having been in power since 2003, under controversial constitutional changes that broadened the president’s powers and came into effect in 2018, Erdogan could run in 2023 for a third presidential term, so could potentially remain at the helm until 2028.

He received congratulatory messages Monday from allies including Russian President Vladimir Putin, Pakistan Prime Minister Imran Khan and Palestinian Authority chairman Mahmoud Abbas.

Religious, nationalist sentiment

In a country where Erdogan wields considerable powers – and where independent media have been under attack for years – the president and his party dominated television coverage during the campaign.

He sought to label opposition parties as tools of his two arch enemies – the separatist Kurdistan Workers’ Party (PKK) and Fethullah Gulen, the U.S.-based cleric and former ally whom he accuses of masterminding a failed coup in mid-2016.

Last month Erdogan provocatively showed excerpts at campaign rallies of a video clip livestreamed by the gunman who killed 50 Muslims in two mosques in New Zealand, invoking religious and nationalist sentiment in a bid for support.

As the election neared, Erdogan also revived talk about changing the Hagia Sophia from its current status as a museum to a mosque.

Built several decades before Islam’s founder was born in the sixth century, Istanbul’s famous landmark served variously as an Orthodox and Catholic cathedral until the 15th century, when the Ottomans turned it into a mosque.

In the 1930s Turkey’s secular government declared the building a museum, but the AKP periodically talks about returning it to a place of Muslim worship.

After Erdogan raised the issue again on the campaign trail, the U.S. Commission on International Religious Freedom (USCIRF) last week condemned the remarks, saying in a statement “Hagia Sophia bears profound historical and spiritual significance to Muslims and Christians alike, and its status as a museum must be maintained.”

USCIRF chairman Tenzin Dorjee called Erdogan’s comments “needlessly provocative and hurtful to Turkey's minority religious communities.”

“Additionally, the implications of such an action are compounded by the deteriorating landscape for religious freedom, democracy and human rights in Turkey.”