|Referendum: "could he become a democratically elected dictator?|
It was the early hours of 16 July 2016.
Around two-dozen Turkish commandos dropped into the grounds of the luxury Club Turban hotel in the coastal resort of Marmaris, armed with automatic rifles and grenades.
Commandos had been sent to capture the president. It should have been the climax of their coup d'etat. Opening fire and hurling grenades, they stormed the hotel, killing two bodyguards.
But they were too late.
Acting on a tip-off, Erdogan had been whisked away from the resort by helicopter. Once at Dalaman Airport, he took a private jet to Istanbul, with his pilot masking its identity so it appeared on radars as a normal civilian passenger plane.
After 03:00, the president emerged outside Istanbul's Ataturk Airport to the roars of his supporters.
The coup attempt had failed - and Recep Tayyip Erdogan was to emerge stronger than ever.
Erdogan went from almost losing control of his country to becoming "untouchable".
But for Turkey's most powerful leader since its founding father, Mustafa Kemal Ataturk, it wasn't enough. After 11 years as prime minister, Erdogan had been elected president in 2014.
The post was traditionally largely ceremonial but Erdogan had other ideas.
The dominant figure in Turkish politics had long dreamed of enshrining his authority through constitutional change, turning Turkey from a parliamentary to a presidential republic, scrapping the post of prime minister and consolidating his hold on the country.
This previously stable corner of the region has become consumed by terror attacks - while once-rapid economic growth has stalled.
Dozens of journalists are in jail. Three million, mostly Syrian, refugees have poured into the country.
Tens of thousands of people have been arrested or dismissed following the failed coup. The country's hope of EU membership is evaporating. And Turkey is arguably more politically polarized than ever.
But at the same time, Turkey has also gone from a financial basket-case at the turn of the century into one of the world's top 20 economies.
The middle-class has hugely expanded. Millions of impoverished Turks have been economically emboldened under Erdogan's leadership.
And now, the country will vote on its future in a referendum which: proposes:
*Prime minster role scrapped, new vice president role created
*President becomes head of government as well as state, and can retain political party ties
*President given sweeping powers, with ability to enact laws by decree and dismiss parliament
*Parliament no longer able to scrutinize ministers
*Parliament given limited powers to investigate or impeach president
Basically, if this referendum passes on the terms as listed above, it will turn Turkey into a democratically legalized dictatorship.