After a divisive campaign fought against the backdrop a state of emergency and a widespread crackdown on dissent, Erdogan succeeded in persuading only 51.4% of voters to back his constitutional upheaval.
The three biggest cities in Turkey -- Ankara, Istanbul and Izmir -- rejected the plans to abolish Turkey's system of parliamentary democracy and replace it with an executive presidency with sweeping, largely unchecked powers.
As "no" campaigners vented their anger, thousands of jubilant supporters of the ruling AKP party filled the streets of the capital, Ankara, beating drums and singing victory songs in Erdogan's name.
The results cement a years-long effort by Erdogan to consolidate his position. After serving as prime minister for nearly a decade, he took over as president in 2014 and through force of personality turned a largely ceremonial role into a de facto head of government.
A failed coup last year allowed him to turn up the heat on opposition voices in the run-up to Sunday's referendum. The "no" campaign said it faced intimidation and threats of violence, and independent monitors say that state media slanted coverage in favor of the president.