Adored by his supporters as a transformative figure who modernised Turkey, his critics label him an increasingly despotic leader who harbours ambitions to establish "one-man rule".
From Attaturk to Erdogan: Turkey marks its 92nd Republic Day
Erdogan's dream of expanding his powers to become a more US-style executive president was stymied at the June election when his Justice and Development Party (AKP) lost its majority, ending 13 years of single party rule.
And with the country shaken to the core by the devastating Ankara bombings and the revival of the bloody Kurdish conflict, opinion polls say it is unlikely the outcome will be any different on Sunday.
Another inconclusive result could see his loyal Prime Minister Ahmet Davutoglu fighting for his political life, and also raise questions about Erdogan's future role.
The towering 61-year-old first came to power as prime minister in 2003, bringing stability after a history of coups and rocky coalitions and dragging the Muslim majority country out of an economic quagmire.
But critics say an increasingly erratic Erdogan is now bent on destroying the secular democracy, imposing his conservative Islamic values on society while silencing his rivals and critical media.
Dramatic evidence of that came just days before the vote when riot police shut down television stations linked to his archfoe, a US-exiled preacher accused of plotting to topple Erdogan by orchestrating a corruption probe that ensnared his inner circle.
"Not since the days of the 1980 military coup have there been such dramatic moves to close down and prevent scrutiny of power," said Human Rights Watch senior researcher for Turkey Emma Sinclair-Webb.
As premier, Erdogan succeeded in clipping the wings of the military -- once powerful guardians of the secular state, and ordinary Turks became suspicious of moves to "Islamise" society by restricting alcohol sales, curbing the Internet and even trying to ban mixed-sex dorms at state universities.
As head of state, Erdogan should stay out of party politics but he remains a powerful influence on the AKP and ruffled feathers when he went on the campaign trail in June.
He was initially hailed in the West for creating a model Muslim democracy on Europe's eastern edge and Turkey had hoped to play a key mediator role on the global stage.
But Ankara lost friends after the Arab spring and relations cooled with the West, particularly over its support for Islamic rebels in the Syrian conflict and for a worsening rights record which hampered its EU aspirations.
Standing almost two metres tall with a notoriously fiery temper, Erdogan is known to himself and followers as the "buyuk usta" - the "big master" - or simply "the Sultan".
Rumours about his health have continued to circulate after he reportedly had two major intestinal operations, but doctors have denied claims he had cancer and he continues to keep up a punishing work schedule.
There is no doubt Erdogan has his eye on his legacy and wants to go down in history alongside modern Turkey's founding father Mustafa Kemal Ataturk as one of its great leaders.
Turkey election a high-stakes gamble for Erdogan
He has launched breathtakingly ambitious projects including a new high-speed rail network and a tunnel beneath the Bosphorus.
But his vast new $615 million presidential palace with 1,150 rooms has been ridiculed as an absurd and tasteless extravagance, a symbol of his creeping authoritarianism.
A piqued Erdogan even sued a political rival for slander for daring to claim it was equipped with golden toilet seats.
He has raised eyebrows with a series of bizarre comments, declaring that Muslims discovered the Americas before Columbus, that women are not equal to men and even boasting "We will wipe out Twitter".
The son of a coastguard officer, he was born in Istanbul's harbourside neighbourhood of Kasimpasa and spent his earliest years in the region of Rize by the Black Sea but returned to Istanbul by his early teens.
He took a degree in business administration and once played semi-professional football for an Istanbul club.
Rising to prominence in the Islamist movement, he became mayor of Istanbul in 1994, tackling urban woes such as traffic gridlock and air pollution in the megacity of 15 million.
When his religious party was outlawed, he joined demonstrations and was jailed for four months for inciting religious hatred when he recited an Islamist poem.
In 2001 Erdogan, along with long-time ally Abdullah Gul and others, founded the Islamic-rooted AKP, which has won every election since 2002.
"The AKP is my fifth child," says Erdogan, who has two sons and two daughters.
Initially barred due to his criminal conviction, he became premier in 2003 when parliament passed new reforms.
Erdogan party hits the hustings ahead of Turkey vote
Under his rule, Turkey showed stellar economic growth rates that were the envy of other emerging markets and adopted an increasingly confident position on the international stage.
But from 2013, Erdogan started to encounter challenges to his rule and he reacted in a combative rather than conciliatory fashion.
His government cracked down on protests over plans to redevelop an Istanbul park that snowballed into nationwide demonstrations against his rule and left eight people dead.
Even as some within his party urged moderation, Erdogan branded the protesters "capulcu" (hooligans).
Anger came to a head again over his response to a mine tragedy last year that claimed 301 lives, when he attempted to downplay the incident by comparing it to mining disasters in 19th-century Britain.
And since he became Turkey's first directly elected president in August 2014, he has become even more pugnacious and some say "Putinised".
"The last dictator!" said one placard brandished by demonstrators protesting at the television raid this week.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ