Turkey on Saturday marked one year since the defeat of the coup aimed at ousting President Recep Tayyip Erdogan with mass rallies seeking to showcase national unity in a divided society and his grip on power.
The authorities have declared July 15 an annual national holiday of "democracy and unity", billing the foiling of the putsch as a historic victory of Turkish democracy.
"It's one year since the darkest night was turned into an epic," Prime Minister Binali Yildirim told a special session of parliament that kicked off a day of celebrations set to last until dawn.
He said the night of July 15 was a "second War of Independence" after the war that led to the creation of the modern Turkish state in the ruins of the Ottoman Empire in 1923.
Two hundred and forty nine people, not including the plotters, were killed when a disgruntled faction of the army sent tanks into the streets and war planes into the sky in a bid to overthrow Erdogan after one-and-a-half decades in power.
But they were thwarted within hours as the authorities regrouped and people poured into the streets in support of Erdogan, who blamed followers of his ally-turned-nemesis, the US-based preacher Fethullah Gulen.
Hundreds of thousands were gathering on the Asian side of the Bosphorus in Istanbul to hear a speech by Erdogan, who earlier arrived from Ankara on his official plane accompanied by an F-16 fighter jet, an AFP correspondent said.
Some carried the Turkish flag while others brandished pictures of the "martyrs" who died defeating the coup bid as a sea of people stretched from the bridge, which has since been renamed Bridge of the Martyrs of July 15.
People chanted "we are soldiers of Tayyip (Erdogan)" and called for the reinstatement of the death penalty for the coup plotters, with some even brandishing nooses.
"We are here for the victims, for democracy, for our country for our people and our flag," said Hakan, a resident of Istanbul.
At midnight local time (2100 GMT) people across Turkey will take part in "democracy watches", rallies commemorating how people poured out into the streets.
In the wake of the failed coup bid, authorities embarked on the biggest purge in Turkey's history, arresting 50,000 people and sacking almost three times as many. Erdogan also shored up his position by winning a referendum on enhancing his powers earlier this year.
In the latest dismissals, another 7,563 police, soldiers and other state employees were fired late Friday under the state of emergency that has been in place since July 20 last year.
Turkey's opposition put political disputes aside on the night of the putsch but the scale of the purge has intensified political divisions.
The celebrations come less than a week after the head of the Republican People's Party (CHP) Kemal Kilicdaroglu held the largest opposition rally in Turkey in years, pushing for "justice".
"Over the last year, the judicial proceedings... moved outside the framework of the law," Kilicdaroglu, whose party will boycott commemoration ceremonies later in the day, told parliament.
He also called for full clarity over what happened on the night of July 15, with questions still remaining over when the authorities first found out an uprising was afoot.
"The details need to be made clear in the name of the martyrs and the heroes," he said, accusing the authorities of "hindering" efforts to find out the truth.
Erdogan, who was present at the session, gazed down stonily from the VIP balcony.
The coup bid also frayed ties between the United States and European Union with NATO member Turkey, which accused its allies of failing to show solidarity.
Gulen has always denied involvement and in a new statement Friday said the accusations were "baseless, politically motivated slanders" and slammed a "witch hunt" of Erdogan's critics.
The scale of Saturday's nationwide commemorations is aimed at etching July 15, 2016 into the minds of Turks as a key date in the history of the modern state.
Giant posters designed by the presidency have sprung up across billboards in Istanbul showing gaudy paintings that portray the key events of the coup night with the slogan "the epic of July 15".
Public transport is free in Istanbul and Ankara over the weekend while mobile operator Turkcell has sent text messages to clients promising them a free extra gigabyte of data from July 15.
Illuminated anti-coup slogans have been hung between the minarets of some of Istanbul's greatest Ottoman mosques.
Erdogan will later return to Ankara and at 2300 GMT give a speech in parliament to mark the time it was bombed.
A giant monument to those killed -- showing people holding up the Turkish star and crescent insignia -- will then be unveiled outside his palace in the capital as the dawn call to prayer rings out.