Dodging his assassins, President Erdogan’s response to the coup encouraged millions of Turkish citizens to stand up to the coup plotters and defend the country's democracy five years ago.
It was a warm summer's night in Istanbul on July 15, 2016 and it quickly became one of the darkest nights in the history of the Turkish republic.
President Erdogan had managed to squeeze a vacation into his busy calendar and he had arrived at the southern seaside presidential resort of Marmaris in Turkey's Mugla province.
He was accompanied by his children, grandchildren and son-in-law, then Minister of Energy and Natural Resources Berat Albayrak.
Erdogan had boarded a helicopter without a presidential seal as he wanted to be away from the public eye, favouring a private moment with his family. His absence from public events prompted questions until a local newspaper revealed his location.
Around 9.30 in the evening on July 15, Erdogan received a phone call from his brother-in-law Ziya Ilgen.
"Something is going on in Beylerbeyi. There are rumours that soldiers are patrolling the Bosphorus Bridge and doing identity checks," Ilgen told the president.
Erdogan later said he was entirely uninformed about the developments until that call. Ilgen was right. By 10.00 pm, the soldiers from a nearby military post shut off the traffic on the Bosphorus bridge and told drivers to go home.
The eye of the storm
A faction within the Turkish army loyal to the Fetullah Terror Organisation (FETO) had deployed troops on the famous Bosphorus Bridge to cut the Asian side of Istanbul from its European shore.
Within hours, fighter jets flew over the main Turkish cities, bombarding government buildings, the parliament, the headquarters of the Turkish intelligence service, while the coup plotters declared taking over the country.
The soldiers were told to open fire on anyone who "dared to challenge" the military and they did so without a second thought, killing 250 civilian protesters and wounding several thousand.
Yet, ordinary Turks refused to give up and they fearlessly confronted the coup plotters on the streets. Some climbed atop tanks, some laid on the ground to stop the tanks from advancing and many walked into the gunfire knowing they might die.
As the rogue soldiers shot at protesters, some quickly dropped dead, while some got back up despite bleeding profusely to resist the violent takeover of the Turkish state.
What shocked the Turkish nation to its core was that the plotters were desperately trying to get hold of President Recep Tayyip Erdogan, who has been leading the country and its ruling AK Party for almost two decades.
Jets flew over Ankara
After that phone conversation, Erdogan tried to call Hakan Fidan, the chief of Turkey’s National Intelligence Organization (MIT), and General Hulusi Akar, the head of the Turkish Armed Forces. But neither of them was reachable.
He understood that something untoward was underway, but could not make out how dangerous the situation had turned. Further phone calls indicated that the military jets were flying low over the state buildings in Ankara, the capital city of the country.
Around 10.00 pm, Erdogan finally got hold of his intelligence chief Fidan.
"I could reach Mr Fidan around 10.00 pm. He gave me a rough information about the situation," Erdogan told A Haber network.
After he learned something was afoot, he called his Chief of Cabinet Hasan Dogan and the director of Erdogan's guard unit, Muhsin Kose.
All presidential guards were given tasks.
The primary plan was to evacuate Erdogan from the holiday residence but if it was impossible in light of the looming threat, the team also made a plan to set up a shelter in the basement.
When all the phone calls indicated a possible uprising, Erdogan was very calm, according to the owner of the property and the son of Erdogan’s old friend, Serkan Yazici.
"I went to the house to ask Erdogan and his family if they need anything. He was sitting in his suit," Yazici said.
"He kept making phone conversations. He looked very calm."
Tanks on the streets
Around 11.00 pm, Prime Minister Binali Yildirim became the first Turkish official to announce that there was a coup attempt by a faction of the military.
By that time, waves of news left everyone in Turkey shocked. WhatsApp groups already began buzzing with instant messages and tweets were raining down on Turkish Twitter with photos of soldiers and tanks on the streets.
While a crowd of local people were gathering near the hotel, a helicopter was waiting for the president on the runway located in front of the building.
Call for resistance
The president had managed to hold a first, very brief press conference at the gate of the residence at 12.04 am. It was recorded by the news outlet Anadolu Agency staff as well as local reporters. But the statement did not get enough coverage as the quality of video and sound was very poor.
Meanwhile, coup plotters raided the public broadcaster TRT's main building in Istanbul and forced the presenter to read their statement in a bid to assert their takeover.
But Erdogan refused to give up. In perhaps one of the most iconic moments of the night, Erdogan addressed the nation via a live broadcast on CNN Turk, which was facilitated by its presenter who held her iPhone to the camera, while FaceTiming with the president.
"Let us gather at our squares and airports – and let them come with their tanks and cannons. Let them do what they will. I have yet to see any power greater than that of the people," Erdogan said while the presenter placed a lapel microphone near the phone screen.
The iPhone FaceTime marked a critical moment in the most chaotic sequence of events. After Erdogan’s appeal, waves of ordinary people hit the roads to counter tanks and armed soldiers.
While the soldiers were firing at anti-coup protesters on the Bosphorus Bridge, sorties of jets bombed government buildings in the capital Ankara. Amidst this mayhem, Erdogan’s plane took off from the Marmaris resort.
The pilots switched their radio transponder to match it with a Turkish Airlines passenger plane so that their aircraft could blend in with civilian traffic.
During the flight, his plane was then harassed by putschists' jets, though they were confronted by friendly fighter jets who were ready to blow the rebel jets out of the sky.
Back in the Marmaris, after the president left, a commando unit consisting of 38 putschists attacked Erdogan's hotel around 3.20 am. By then, the president was on the plane, flying from Dalaman to Istanbul.
They stormed the building, killing two policemen from the president's rearguard and wounding 25 others. Thirty-seven of the Marmaris attackers were arrested in the following days.
Erdogan arrived at the Ataturk Airport in Istanbul around 3.30 am.
But the airport, including its control tower, was occupied by the putschist troops, who faced stiff resistance from thousands of people and police forces. In a major scuffle, the police managed to bring them down on their knees. Erdogan's plane circled south of Istanbul for a length of time in a holding pattern. Eventually, the president landed and he received a warm welcome from thousands of people.
But his brief speech at the airport was not a victory speech as the clashes between people and coup perpetrators continued for hours.
Around 6.45 am, the soldiers on Bosphorus Bridge raised white flags and laid down their arms. As the sun rose, the Turks, who had seen a military coup every ten years, emerged triumphant in successfully defending their democracy and stopping a military takeover for the first time in the history of Turkey.