ISTANBUL - Recep Tayyip Erdogan has cemented his status as the most important figure in modern Turkish history, after victory in Sunday's presidential runoff extended his transformative two-decade rule to 2028.
The ultimate political survivor, Erdogan, 69, has overcome jail and a bloody 2016 coup attempt to steer his country through an era of diplomatic clout, economic development and political strife.
An unprecedented opposition coalition, galvanised by a biting economic crisis and fury over a calamitous February earthquake, represented the toughest national electoral challenge for the Islamic-rooted conservative.
But while polling forecast he was closer to defeat than ever, Erdogan beat the odds yet again to come within a whisker of winning in the first round before clinching victory on Sunday.
He defeated his secular opposition rival, Kemal Kilicdaroglu, by four percentage points -- closer than any other election, but enough to end his political career undefeated in national polls.
His aura of invincibility reaffirmed, none can deny Turkey's longest-serving leader is the country's most consequential since Mustafa Kemal Ataturk, the revered founder of the post-Ottoman republic.
Admirers laud Erdogan for unshackling religious restrictions in the officially secular but mostly Muslim state, overseeing ambitious infrastructure projects and turning Turkey into a geopolitical force.
Detractors accuse him of slipping into authoritarianism reminiscent of the Ottoman sultans, shaking Turkey's democratic foundations and impoverishing millions through misguided beliefs that contradict conventional economics.
- Rewriting the rules -
Although the runoff provided his rule with a fresh mandate, the nation of 85 million is likely to remain sharply polarised.
Known to his inner circle as "beyefendi" (sir) and to admirers as "reis" (the chief), Erdogan prides himself on being able to woo doubters through tireless campaigning.
This passion has helped him and his party win more than a dozen local and national votes, allowing Erdogan to claim a people's mandate for his foreign military adventures and domestic clampdowns on dissent.
Erdogan risked his political domination on a 2017 referendum on abolishing the office of prime minister and handing greater powers to the president.
He eked out a narrow win then, enfeebling parliament and enabling him to effectively rule by decree. It also gave him the constitutional loophole needed to run for two more terms in office -- an outcome set to be fulfilled.
- Power and protests -
Born in a working-class harbour district of Istanbul, Erdogan made his name in nascent Islamic movements that were challenging secular domination, becoming the city's mayor in 1994.
His mayoral term was cut short when he was convicted and jailed for four months for inciting religious hatred when he recited a fiery poem that compared mosques to army barracks and called minarets "our bayonets".
Among supporters, this only seemed to magnify his appeal.
Founding the AKP after an earlier Islamic party was banned, Erdogan spearheaded its 2002 landslide election victory and became premier less than six months later.
Erdogan's signature early achievements included a series of reforms that gladdened the European Union, including abolishing the death penalty and beginning a peace process with Kurdish militants.
Mass protests in 2013 over plans to turn an Istanbul park into a shopping mall marked the start of a more divisive era that included corruption allegations levelled against his inner circle.
Turkey's bid to join the EU faltered and peace talks with the Kurds imploded in 2015, when a Kurdish opposition party helped to wrest control of parliament from Erdogan for the first time.
Turkish military operations against Kurdish forces in Syria and Iraq soon followed, creating new tensions with the West.
- Abandoned by allies -
In its early days the AKP, lacking allies and experience, forged an alliance with Islamic preacher Fethullah Gulen, who moved to permanent US exile in 1999 but retained strong influence in Turkish society and government.
Erdogan blamed Gulen for masterminding a bloody coup bid by a renegade army faction in July 2016 -- charges he denies.
The president, on holiday in the Aegean, appeared on the FaceTime app on live TV to urge supporters out onto the streets.
It became the defining moment of his subsequent rule.
Erdogan fought back with sweeping purges that led to 80,000 arrests, brought most media under government influence and created a sense of looming peril among those opposed to his rule.
Washington and the EU's hesitation to openly support Erdogan in the first hours of the coup bid eroded his trust in the West and created diplomatic frictions that linger to this day.
Unorthodox economic policies, including lowering interest rates to fight soaring inflation that officially reached 85 percent in 2022, erasing some gains of his more prosperous first decade of rule.
Opponents accused him of turning a blind eye to corruption and lax building standards that allowed entire cities to crumble in this year's earthquake.
Despite the widespread loss and anger, Erdogan's popularity held up in parts of southeastern Turkey laid to waste by the disaster -- a testament to a loyal bedrock of support.