President Tayyip Erdogan claimed victory in Turkey's presidential election on Sunday, a win that would steer his increasingly authoritarian rule into a third decade after he saw off his toughest political challenge yet.
Addressing supporters from on top of a bus in Istanbul, Erdogan thanked people for voting and said Turks had given him the responsibility of governing for the next five years.
"The only winner is Turkey," he said.
Final official results have yet to be released.
There was no immediate response to Erdogan's victory speech from his challenger, Kemal Kilicdaroglu, who had the backing of a six-party opposition alliance.
Russian President Vladimir Putin offered congratulations to Erdogan. The presidents of Iran and Algeria and the Emir of Qatar were among leaders to congratulate him in the Middle East, where he has asserted Turkish influence, at times with military power.
The election had been seen as one of the most consequential yet for Turkey, with the opposition believing it had a strong chance of unseating Erdogan after his popularity was hit by a cost-of-living crisis.
Instead, victory will reinforce his image of invincibility, after having already redrawn domestic, economic, security and foreign policy in the NATO member country of 85 million people and positioned Turkey as a regional power.
Supporters gathered at his Istanbul residence in anticipation of victory as data reported by both the state-run Anadolu agency and the opposition ANKA news agency gave him the edge with nearly 99% of ballot boxes counted.
The head of the High Election Board earlier told a news conference that Erdogan was leading Kilicdaroglu with 53.41% support, with 75.42% of ballot boxes logged.
Erdogan, head of the Islamist-rooted AK Party, appealed to voters with nationalist and conservative rhetoric during a divisive campaign that deflected attention from deep economic troubles.
The defeat of Kilicdaroglu, who promised to set the country on a more democratic and collaborative path, would likely be mourned in Western capitals which have been alarmed by his ties to Russia.
Across the Middle East, the prospect of five more years of Erdogan does not appear to be prompting the alarm it might once have after he reached accommodations with several of the governments with which he had been at odds.
Erdogan supporters who gathered outside his Istanbul residence chanted Allahu Akbar, or God is Greatest.
"I expect everything to become better," said Nisa, 28, a headscarved woman wearing a headband with Erdogan's name.
Another Erdogan supporter said Turkey would get stronger with him in office for five more years.
"There are issues, problems in every country around the world, in European countries as well ... With strong leadership we will overcome Turkey's problems as well," said the supporter who gave his name as Mert, 39, as he celebrated with his son.
Bugra Oztug, 24, who voted for Kilicdaroglu, blamed the opposition for failing to change. "I feel sad and disappointed but I am not hopeless. I still think there are people who can see the realities and truth," Oztug said.
Erdogan's performance has wrong-footed opponents who thought voters would punish him over the state's initially slow response to devastating earthquakes in February, in which more than 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.
Erdogan's economic policies are the new focus
Emre Erdogan, a political science professor at Istanbul's Bilgi University, attributed Erdogan's success to his supporters' belief "in his ability to solve problems, even though he created many of them."
Erdogan had also maintained the support of conservative voters who long felt marginalized by the secular elites that used to dominate Turkey. "This era will be characterized by a decline in political and civil liberties, polarization, and cultural fights between two political tribes," he said.
Erdogan appeared to have prevailed despite several years of economic turmoil which critics blame on unorthodox economic policies which the opposition had pledged to reverse.
Uncertainty about what an Erdogan win will mean for economic policy pushed the lira to record lows last week.
Reuters reported last week that there is disagreement and uncertainty within Erdogan's government over whether to stick with what some call an unsustainable economic programmed or to abandon it.
Critics had declared the vote a test of whether such an autocratic leader could be peacefully removed.
But ahead of the first-round presidential election on May 14, Erdogan - a veteran of a dozen election victories - said he respected democracy and denied being a dictator.
Kilicdaroglu, who ran a mostly inclusive campaign in the face of attacks from Erdogan, had promised to reset governance, restore human rights, and return independence to the courts and central bank after they were sidelined over the last decade.
After his ruling alliance won a comfortable majority in parliament in the May 14 vote, Erdogan had warned that a diverse opposition alliance of six parties would struggle to govern and he would continue his strong leadership in a new five-year term as president.