ISTANBUL (AFP) - After 15 years in office that have already transformed his country, Turkish President Recep Tayyip Erdogan is set to return to power aiming to establish himself alongside founder Mustafa Kemal Ataturk as the leading figures of modern Turkish history.
Erdogan, 64, has in his political career overcome a stint in prison, mass protests and even a bloody coup attempt to emerge as Turkey's uncontested leader, first as premier and then as president from 2014.
He has freed up constraints on religion in the officially secular but overwhelmingly Muslim state, overseen a vast programme of infrastructure-building he calls his "crazy projects" and implemented a more assertive foreign policy.
For supporters, Erdogan gives a voice to Turkey's conservative Muslim majority, has brought new levels of economic prosperity and commands respect on the international stage.
But detractors argue that Erdogan is taking Turkey on a dangerous path to authoritarianism reminiscent of the Ottoman Sultans, coupled with reckless handling of the economy and an imperial foreign policy.
In any case, Erdogan is here to stay, declaring victory on Sunday (June 24) in presidential and parliamentary elections seen as the biggest challenge of his career against a resurgent opposition.
"Now is the time to work, set aside the tensions from the election period and focus on the country's future," he said in his victory speech.
'THE HEAVYWEIGHT CAMPAIGNER'
If there was a global contest for winning elections, Erdogan would see himself as the undisputed - and undefeated - heavyweight champion of the world.
In one and a half decades since his ruling party came to power, Erdogan has now taken part in 14 elections - six legislative polls, three referenda, three local elections and two presidential votes - and won them all.
Known to his inner circle as "beyefendi" (sir) and to admirers as "reis" (the chief), Erdogan prides himself on being able to woo doubters with his indefatigable campaigning.
His only setback - so far - came in June 2015 elections when the AKP won the most votes but lost its overall majority for the first time.
But Erdogan swatted away the prospect of a coalition, saying such governments belonged to the days of "old Turkey". He called new elections in November 2015 where the party's majority was restored.
Erdogan pressed on with an April 2017 referendum on a new constitution that abolishes the office of prime minister and that critics said resembled an autocracy, but eked out a relatively narrow win.
FROM KASIMPASA TO PRESIDENCY
Born in the working-class Istanbul harbour district of Kasimpasa but brought up near the Black Sea, Erdogan gained prominence in the nascent Islamic political movements that were challenging secular domination, becoming a popular mayor of Istanbul in 1994.
His term was cut short when he was convicted and then jailed for four months for inciting religious hatred when he recited an Islamist poem. But this only magnified his profile.
Founding the AKP after the previous Islamic party led by his mentor Necmettin Erbakan 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 like abolishing the death penalty that gladdened the EU and beginning a peace process with Kurdish militants.
Mass protests in summer 2013 over plans to turn an Istanbul park into a shopping mall marked the start of a more divisive era as Erdogan came out fighting, dismissing the protesters as "hooligans".
Tensions further increased later that year when a corruption scandal broke implicating Erdogan's inner circle. The allegations enthralled his opponents but his supporters rubbished the claims.
The accession process to join the EU ground to a halt - with Erdogan complaining Ankara was being "kept waiting at the door" - and in 2015 the peace process for the Kurdish-majority south-east collapsed.
In its early days the AKP, lacking allies and experience, forged an alliance with Islamic preacher Fethullah Gulen who moved to permanent exile in the US in 1999 yet built huge influence in Turkish society.
But Gulen turned against his former allies who blamed him for masterminding the July 15, 2016 coup bid by a renegade army faction, 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, before returning in triumph to Istanbul and describing the events as a "gift from God".
The coup bid marked a watershed moment in Erdogan's rule with some 77,000 arrested in the unprecedented purge that followed, further increasing tensions with the West.
And his increasingly pugnacious style has alienated some former allies such as predecessor Abdullah Gul, a co-founder of the AKP who even mulled standing against Erdogan in Sunday's polls.
Family is key for Erdogan and one of his closest confidants is his energy minister and son-in-law Berat Albayrak, the husband of his eldest daughter Esra.
His younger daughter Sumeyye plays a key role in a women's non-profit but, in contrast, his two sons are less prominent.