ISTANBUL - The Turkish lira firmed on Monday, clawing back early losses after President Tayyip Erdogan's AK Party lost control of the capital Ankara in local elections and trailed in Istanbul, Turkey's largest city, as the last votes were tallied.

At 1137 GMT, the lira stood at 5.5290 against the U.S. dollar, firming from Friday's close of 5.5550. It weakened as far as 5.7001 in early trade.

The lira tumbled almost 30 percent against the dollar in last year's currency crisis. In an echo of that crisis of confidence, it has swung wildly in the last six trading days as the government and central bank unleashed a series of stop-gap support measures.

Turkey's economic recession weighed on voters.

In Istanbul, the mayoral candidate of the main opposition Republican People's Party (CHP), Ekrem Imamoglu, and his AKP rival, ex-prime minister Binali Yildirim, both said Imamoglu was around 25,000 votes ahead. Earlier, both parties had declared victory.

In Ankara, the CHP mayoral candidate, Mansur Yavas, won a clear victory, according to Turkish broadcasters.

The results, if they stand, will mark the first time the AK Party and its Islamist predecessors have lost control of Turkey's two largest cities in 25 years.

POPULIST MEASURES

Markets are nervous that the results of the election will lead Erdogan to pursue more populist measures, said Inan Demir, senior emerging market economist at Nomura.

"The losses in the largest cities will lead him to be more defensive, trying to shore up electoral support via populist measures, which increases risks for markets, for fiscal policy and monetary policy," he said.

Istanbul's BIST 100 stock index rose 0.91 percent on Monday.

In a speech early on Monday, Erdogan pledged that Turkey would now focus on its troubled economy. Turkey slipped into recession late last year.

"The expectation is that emphasis will be given to needed structural reforms in a period of four years without elections," said one banker, who declined to be identified.

"If there is a delay in this, it will increase pressures on markets," he said, adding that the lira would likely remain in a 5.50-5.70 band while the uncertainty persists.

In the week ahead of elections Turkish stocks, bonds and the currency sold off, prompting the government to direct banks to temporarily starve a key London market of lira liquidity, according to officials.

Investors were also weighing up a statement on Monday from Moody's rating agency, which said the erosion of Turkey's foreign currency reserves is a credit negative and that central bank use of reserves to prop up the lira currency poses renewed questions about its transparency and independence.

The renewed slip in Turkey's financial markets and uncertain policy reaction to recession raises a risk of further capital flight, Moody's said, adding that the results of local polls would likely determine the future path of macroeconomic policy.

Both Erdogan and Finance Minister Berat Albayrak, the president's son-in-law, have promised to implement reforms after the elections to address economic woes.

Every decision by the government will have an impact on the lira as investors look forward to a package of reforms to be revealed in coming weeks to restore confidence in the lira after last week's drastic measures, said Piotr Matys, emerging markets forex strategist at Rabobank.

"While all previous AKP electoral victories were perceived as a source of political stability, on this occasion investors could be reluctant to give the administration benefit of the doubt that the next four years will be dominated by efforts to rebalance the economy and address structural vulnerabilities."

(Reporting by Daren Butler, Behiye Selin Taner, Ezgi Erkoyun, Sarah Dadouch and Ali Kucukgocmen; Editing by Jonathan Spicer and Gareth Jones) ((mailto:daren.butler@tr.com; +90-212-350 7053; Reuters Messaging: rm://daren.butler.thomsonreuters.com@reuters.net))