The Justice and Development Party (AKP) co-founded by Erdogan won the most votes in Sunday's elections but lost its absolute majority in parliament for the first time since it came to power in 2002.
The result has scuttled Erdogan's plan to push through the constitutional changes he yearns for to create a presidential system that would give him greater powers.
Erdogan, 61, who served as premier from 2003 and then became president in 2014, is lauded by his supporters as a transformative figure who modernized Turkey and handed power back to the people.
His vast new $615 million presidential palace on the outskirts of Ankara, slammed by the opposition as an absurd extravagance, has become a symbol of his perceived aloofness and authoritarianism.
During the election campaign Erdogan was more divisive than ever, showing no mercy in attacks on opponents and telling foreign media who criticized him to "know your limits".
With an eye on his legacy, Erdogan wants to be ranked alongside Turkey's post-Ottoman founding father Mustafa Kemal Ataturk as one of its great transformative figures and could stay in power to 2024.
A towering figure of almost two meters tall with a notoriously fiery temper, he is known to himself and followers as the "buyuk usta" – the "big master" – or simply as "the Sultan".