ISTANBUL (AFP) - Turkey marks one year on July 15 since a coup attempt aiming to topple President Recep Tayyip Erdogan that failed within hours but resulted in far-reaching consequences for its society and politics.
The country is in the throes of the biggest purge in its history against alleged coup supporters, while Mr Erdogan has seen his grip on power tightened rather than weakened.
But Turkey is also facing some isolation on the diplomatic stage, experiencing tense relations with the European Union and the United States, and now trying to limit the damage from an explosive crisis over its ally Qatar in the Gulf.
"One year on from the coup bid, President Erdogan is stronger than ever," said Mr Ozgur Unluhisarcikli, Ankara office director of the German Marshall Fund of the US.
But he added the crackdown has "unavoidably weakened Turkey's international standing, particularly vis-a-vis Europe and the United States" .
On the night of July 15, 2016, an army faction disgruntled with Mr Erdogan's one-and-a-half decades of domination sought to seize power, closing the bridges in Istanbul, bombing Parliament in Ankara and deploying tanks in the streets.
But the coup bid unravelled as Mr Erdogan returned in triumph to Istanbul from holiday and tens of thousands of ordinary Turks poured into the streets to oppose the plotters.
Two hundred and forty nine innocent people died in the coup and are regarded as "sehitler" (martyrs for Islam).
The authorities see the coup bid's defeat as a victory for democracy and have renamed the Bosphorus Bridge in Istanbul that was a centre of the fighting the "Bridge of the 15 of July Martyrs".
Extensive commemorations are planned for Saturday, including a speech by Mr Erdogan on the bridge, with July 15 now declared an annual holiday, the Democracy and National Unity Day.
Turkey's longest night left a sequence of images engraved into the memory - including the tear-stained face of the state television presenter forced to make a statement by the coup plotters, and Mr Erdogan peering out through the FaceTime app as he made a live appeal to supporters.
Mr Erdogan swiftly said the coup bid was masterminded by his one-time ally-turned-nemesis, the US-based Islamic preacher Fethullah Gulen, who has over the decades assiduously built up influence in the judiciary, police and the army.
From his secluded base in Pennsylvania, Mr Gulen denied the charges. But Mr Erdogan vowed to wipe out the "virus" of Mr Gulen from Turkish institutions.
Turkey subsequently embarked on the most extensive crackdown in its modern history, arresting more than 50,000 people and sacking 100,000 more from their jobs.
Critics say the state of emergency imposed on July 20 last year - which remains in place - has been used to go after all opponents of Mr Erdogan, including critical journalists, activists and pro-Kurdish politicians who opposed the putsch bid.
After landing in Istanbul in one of the turning points of the July 15 coup bid, Mr Erdogan described the attempt as a "blessing from God" and critics have accused him of opportunistically exploiting the events.
On April 16, he narrowly won a referendum that from 2019 will grant him sweeping new powers and also allow him to resume his leadership of the ruling Justice and Development Party (AKP).
"His control over the AKP is absolute and as a result of the atmosphere of fear created through the post-coup attempt purges, his control over the bureaucracy, private sector and media are tighter than ever," said Mr Unluhisarcikli.
Turkey's modern history has been littered with repeated interventions by the once all-powerful military, including the 1960 coup that led to the execution of then Prime Minister Adnan Menderes, Mr Erdogan's political hero.
The July 15 bid marked the first time in Turkey's history that a military coup had between thwarted, and Mr Erdogan rapidly tightened his grip on the military.
Around half of all Turkish generals were either arrested or fired after the coup bid.
The coup's defeat even spawned an officially approved anthem that blares out at Mr Erdogan's rallies: "On the night of July 15, the weather was hot/An attempt of betrayal that burned the heart."
Yet questions remain over the timeline, with testimony indicating the army received intelligence of a possible uprising as early as the afternoon of July 15.
But Mr Erdogan, who was holidaying in the resort of Marmaris, found out about the plot so late that, according to his own statements, he was just 15 minutes from death.
"Although it is nearly one year after the coup, it does not seem easy to close the discussion over the intelligence aspects," wrote a columnist for the Hurriyet daily, Sedat Ergin.
As a Nato member and EU candidate, Turkey lamented the lack of American and European solidarity, with Ankara seeing Brussels as more fixated on the ensuing crackdown than condemning the attempt to oust the democratically elected government.
Tensions rose between Ankara and Washington over the failure of the US to extradite Mr Gulen, with the new administration of President Donald Trump dashing hopes of any shift.
By contrast, Russian President Vladimir Putin was quick to back Mr Erdogan, helping seal a rapprochement.
But in the Gulf, Turkey was last month disturbed by the Saudi-led sanctions slapped on Qatar, its main ally in that region.