President Tayyip Erdogan extended his two decades in power in elections on Sunday, winning a mandate to pursue increasingly authoritarian policies which have polarised Turkey and strengthened its position as a regional military power.
His challenger, Kemal Kilicdaroglu, called it "the most unfair election in years" but did not dispute the outcome.
Official results showed Kilicdaroglu won 47.9 per cent of the votes to Erdogan's 52.1 per cent, pointing to a deeply divided nation.
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 and reversing his policies after his popularity was hit by a cost-of-living crisis.
Instead, victory reinforced his image of invincibility, after he had already redrawn domestic, economic, security and foreign policy in the NATO member country of 85 million people.
The prospect of five more years of his rule was a major blow to opponents who accused him of undermining democracy as he amassed ever more power - a charge he denies.
In a victory speech in Ankara, Erdogan pledged to leave all disputes behind and unite behind national values and dreams but then switched gears, lashing out at the opposition and accusing Kilicdaroglu of siding with terrorists without providing evidence.
He said releasing former pro-Kurdish party leader Selahattin Demirtas, whom he branded a "terrorist," would not be possible under his governance.
Erdogan said inflation was Turkey's most urgent issue.
Kilicdaroglu's defeat will likely be mourned by Turkey's NATO allies which have been alarmed by Erdogan's ties to Russian President Vladimir Putin, who congratulated his "dear friend" on his victory.
US President Joe Biden wrote on Twitter: "I look forward to continuing to work together as NATO Allies on bilateral issues and shared global challenges."
US relations with Turkey have been impeded by Erdogan's objection to Sweden joining NATO as well as Ankara's close relationship with Moscow and differences over Syria.


Explosion kills 6, injures 10 in Vietnam capital Hanoi
Pakistani pilot to become first foreigner to fly to China's space station
Sheikh Hasina seeks to return to Bangladesh on December 16 on state carrier
Israeli airstrikes kill at least six Palestinians in Gaza, medics say
Israeli airstrike kills at least 3 Palestinians in southern Gaza, medics say
South Korea toughens school exam rules after smart-device cheating scandal
Russian attack on Ukraine's Dymer in Kyiv region kills 11, official says
India announces $1.62 billion package for flood-hit Nepal
