ISTANBUL (Reuters) - President Tayyip Erdogan and supporters on Monday revelled in an election victory lengthening his rule into a third decade while Turkey's opposition, which once counted on winning, braced for "difficult days" against an increasingly autocratic government.
His rival Kemal Kilicdaroglu said it was "the most unfair election in years" but did not dispute the outcome, which gave Erdogan a mandate to pursue policies that have polarised Turkey and strengthened its position as a regional military power.
The election had been seen as Erdogan's biggest political challenge, with the opposition confident of unseating him and reversing his policies after polls showed a cost-of-living crisis left him vulnerable.
But he prevailed with 52.2% of the vote to Kilicdaroglu's 47.8%. It reinforced Erdogan's image of invincibility in the deeply divided NATO-member country, whose foreign, economic and security policy he has redrawn.
Pro-government newspapers, part of an overwhelmingly pro-Erdogan media landscape that buoyed his election campaign in the nation of 85 million people, cheered his victory.
"It's a good result because Tayyip Erdogan is a good leader, he knows what the people want. If people have been voting for him for 20 years, he must be a successful leader," said Altay Sahin, a construction worker in Istanbul.
Addressing supporters in a victory speech, Erdogan declared democracy the winner. "Now is the time to put the disputes and conflicts of the election period to one side and unite around our national goals," he said.
But the prospect of five more years of Erdogan rule was a harsh blow to an opposition which accused him of undermining democracy as he amassed ever more power - a charge he denies. Kilicdaroglu had promised a new "spring" if he had won.
"I look at the people around me, who were supporting the opposition, and all of them are resentful," said Hulya Yildirim, a lawyer. "We forgot about spring in this country, we have to make our own spring because the people seem to be happy with winter."
The lira slipped to a record low of 20.08 against the dollar. It has lost 90% of its value in the last decade, buffeted by currency crisis and rampant inflation.
Its most recent losses were driven by uncertainty about what an Erdogan win would mean for economic policy. Critics have blamed his unorthodox, low interest-rate economic blueprint that the opposition had pledged to reverse, for the currency's woes.
Erdogan said inflation, which hit a 24-year peak of 85% last year before easing, is Turkey's most urgent issue.
Though he called for unity, Erdogan stuck to a major theme of his campaign in accusing Kilicdaroglu and the opposition of siding with terrorists, without providing evidence.
Turkey's main pro-Kurdish party, parliament's third largest, was among the opposition parties opposed to Erdogan and is accused of links to Kurdish militants, which it denies.
"For the opposition, very difficult days are ahead," said Atilla Yesilada, analyst at GlobalSource Partners, forecasting more judicial moves against the Kurdish party and saying it was not clear whether the opposition alliance would remain intact.
Kilicdaroglu's defeat will probably be a cause for concern among Turkey's NATO allies that have been alarmed by Erdogan's amicable relations with Russian President Vladimir Putin, who congratulated his "dear friend" on his victory.
U.S. President Joe Biden wrote on Twitter: "I look forward to continuing to work together as NATO allies on bilateral issues and shared global challenges." He and Erdogan were to speak by phone later on Monday, Erdogan's office said.
U.S. relations with Turkey have been impeded by Erdogan's objection to Sweden joining NATO as well as Ankara's close relationship with Moscow, even as Russian forces wage a 15-month-old invasion of Ukraine, and differences over Syria.
Erdogan's victory extends his tenure as the longest-serving leader since Mustafa Kemal Ataturk established modern Turkey after the collapse of the Ottoman Empire a century ago - a politically potent anniversary to be marked in October.
Erdogan, head of the Islamist-rooted AK Party, appealed to voters with nationalist and conservative rhetoric in a divisive campaign that deflected attention from Turkey's economic problems.
Kilicdaroglu, who had promise to set Turkey on a more democratic and collaborative path, said the election outcome showed there was a will among many Turks to remove an authoritarian government, but "all the means of the state were laid at the feet of one man".
Erdogan's performance wrong-footed opponents who thought voters would punish him over the state's initially slow response to earthquakes in February, in which over 50,000 people died.
But in the first round of voting on May 14, which included parliamentary elections, his AK Party emerged top in 10 of the 11 provinces hit by the earthquakes, helping it to secure a parliamentary majority along with its allies.
(Additional reporting by Ayhan Uyanik, Can Sezer, Burcu Karakas and Jonathan Spicer in Istanbul and Nevzat Devranoglu in Ankara; writing by Daren Butler; editing by Jonathan Spicer, William Maclean and Mark Heinrich)