Military coups in Turkey have unseated four elected governments in the past 50 years, although armed forces have not seized power directly since 1980.
This latest failed attempt, which ended with mass casualties and arrests, sits against a backdrop of regional conflict, violent attacks and public protest.
A successful overthrow of President Recep Tayyip Erdogan, who has ruled the country of about 80 million people since 2003, would have marked one of the biggest shifts in the Middle East in years, transforming a major US ally.
However, the attempt could still destabilise a NATO member that lies between the European Union and the chaos of Syria, with Islamic State bombers targeting Turkish cities and the government also at war with Kurdish separatists.
Mr Erdogan is a polarising figure, whose Islamist-rooted ideology lies at odds with supporters of modern Turkey's secular principles.
His AK Party has long had strained relations with the country's military, which has a history of mounting coups to defend secularism.
While loved by his supporters, Mr Erdogan's conservative religious views have also alienated many ordinary Turks who accuse him of authoritarianism. Police used heavy force in 2013 to suppress mass protest demanding more social freedom.
Turkey, meanwhile, is one of the main backers of opponents of Syrian President Bashar al-Assad in that country's civil war, host to 2.7 million Syrian refugees and launchpad last year for the biggest influx of migrants to Europe since World War II.
Turkey has suffered numerous bombings and shootings this year, including an attack two weeks ago by Islamists at Ataturk Airport that killed more than 40 people, as well as those staged by Kurdish militants.
After serving as prime minister from 2003, Mr Erdogan was elected president in 2014, with plans to alter the constitution to give the previously ceremonial presidency far greater executive powers.
Turkey has enjoyed an economic boom during his time in office and has dramatically expanded its influence across the region. However, opponents say his rule has become increasingly authoritarian.
The following list gives some details about the military coups in the country in the last 50 years.
1960 - 'Bloodless' coup followed by executions
An almost bloodless military coup was led by officers and cadets from the Istanbul and Ankara war colleges. The leaders established a 38-member National Unity Committee.
Of 601 people tried, 464 were found guilty. Three former ministers, including Prime Minister Adnan Menderes, were executed and 12 others, including President Celal Bayar, had death sentences commuted to life imprisonment.
1971 - 'Coup by memorandum'
The military delivered a warning to the government to restore order after months of strikes and street fighting between leftists and nationalists. Months later, Prime Minister Suleyman Demirel stepped down and a coalition of conservative politicians and technocrats set to restore order under the supervision of the military.
Martial law was established in several provinces and not completely lifted until September 1973.
1980 - Military coup
The senior command of the army led by General Kenan Evren, carried out a coup after a resurgence of street fighting between leftists and nationalists.
Leading politicians were arrested, and parliament, political parties, and trade unions were dissolved. A five-member National Security Council took control, suspending the constitution and implementing a provisional constitution that gave almost unlimited power to military commanders.
1997 - 'Post-modern coup'
Prime Minister Necmettin Erbakan, denounced by opponents as a danger to the country's secular order, stepped down under pressure from the military, business, the judiciary and fellow politicians.
The generals saw themselves compelled to act to defend the secular state founded by Mustafa Kemal Ataturk.
2007 - 'Fake conspiracy'
The shadowy Ergenekon group first came to light when a cache of explosives was discovered in a police raid on an Istanbul house, and hundreds of people went on trial for an alleged coup attempt against then-Prime Minister Recep Tayyip Erdogan.
Guilty verdicts against 275 officers, journalists, lawyers were all overturned this year after the appeals court ruled Ergenekon was not proven to exist.
Mr Erdogan, who became president in 2014, initially supported the prosecution but later blamed police and prosecutors for faking the conspiracy. He denies playing any role.
2010 - 'Sledgehammer'
A newspaper revealed a secularist coup plot, dubbed Sledgehammer, that reportedly dated back to 2003, aimed at fomenting social chaos to topple Mr Erdogan's Islamist-rooted AK Party.
In 2012, a court jailed 300 of the 365 defendants. Two years later, almost all of those convicted were freed after the Constitutional Court ruled their rights had been violated.