ISTANBUL – Polls have closed in Turkey's nationwide local elections on Sunday, a vote expected to be the toughest Turkish President Recep Tayyip Erdogan has faced, with the control of the capital Ankara and Istanbul at risk.

With the economy in recession and soaring inflation, economic concerns were first and foremost on many voters' minds.

Erdogan Faces Toughest Challenge in Key Local Polls

"Our economy is getting worse and worse because of their (government) bad management," said Erdem, an engineer, speaking before voting in Istanbul. "Most of my friends are now looking for a job and some my friends lose their job because of economic crisis."

Erdogan Faces Toughest Challenge in Key Local Polls

Istanbul is Turkey's largest city and the country's financial capital. According to opinion polls, the election there was too close to call. Erdogan's AK Party has controlled the city for more than 15 years.

Erdogan Faces Toughest Challenge in Key Local Polls

"My expectation is there will be good things coming out of this election, we will win with a big difference," said Sinan, an AKP supporter speaking after voting in Istanbul.

Voters in Ankara spoke about the country's economic problems.

"The youth in this country are unemployed. We know the hardships of people who don't have a job. The only solution to this is creating jobs," Orhan Kurubacak told VOA.

"I don't think things are going well. There is nothing more else to say. There are a lot of economical factors," Hakan Akyürek said.

One AKP candidate, Cumali AttIla, told VOA's Kurdish service, "I hope these elections would end with gumption. It is our responsibility to claim democracy."

Even though Erdogan was not on the ballot, he took personal control of the local election campaign. In a sign of what analysts suggest are fears of losing Istanbul, Erdogan in the last few days held more than a dozen rallies across the city in a bid to consolidate his party's support.

Throughout the campaign Erdogan sought to move the agenda away from economic woes, instead focusing on security concerns, and the threat posed by Kurdish separatists, along with a religious agenda.

Erdogan repeatedly played videos of a massacre of Muslims praying in New Zealand mosques at his rallies. The Turkish president likes to present himself as as a protector of Muslims around the world; a stance analysts say plays well with his religious and nationalist base.

In another move aimed at his base, Erdogan, days before Sunday's poll, promised to turn Istanbul's Hagia Sophia Museum, once one of Christiandom's most important churches, into a mosque.

However, analysts say Erdogan struggled to change the agenda away from the economy. With Turkey in the grip of soaring food prices, over 30%, "the key issue for the next local elections in Turkey is the economy," professor Baris Doster of Istanbul's Marmara University said.

"I think that the most powerful and effective opposition parties are not the classical parties, like the Republican People's Party or the Good Party. However, the key issue for the elections is the increasing prices of vegetables. Let's say the prices of cucumbers or tomatoes. These are the most effective oppositions of Turkey," Doster added.

In a bid to alleviate public anger over rising prices, state-subsidized food was sold in Ankara, Istanbul and other major cities in the run-up to the local elections. However, analysts say the images of people queuing up for food appears to have only underlined opposition claims the country is in crisis.

Erdogan appears to have also been wrong-footed by the surprise move of the pro-Kurdish HD Party's decision not to contest the main cities outside of Turkey's predominantly Kurdish southeast region.

"Our strategy is based on winning in the east and making them lose in the west," said Gul Demir, co-head of HDP in Istanbul's Kadikoy district.

Demir says her party is calling on its supporters to vote for the main opposition CHP party. The HDP, Turkey's second-largest opposition party, accounts for nearly 10% of the electorate in cities like Istanbul and Ankara.

While courting Turkish nationalist voters Erdogan has targeted the HDP, calling the party terrorists partly linked to Kurdish insurgents the PKK. Thousands of its officials have been jailed in a crackdown, including elected mayors and parliamentary deputies.

The HDP is seeking to win in Turkey's predominantly Kurdish region, in towns and cities where party mayors have been removed from office and jailed by the state, accused of supporting Kurdish insurgents.

Pervin Buldan, co-chair of HDP, said votes cast Sunday for her party "will contribute to peace, freedom and equality."