ISTANBUL/ANKARA - Turkish President Tayyip Erdogan's supporters rallied in public squares, at Istanbul airport and outside his palace overnight in a show of defiance after a failed coup attempt killed at least 265 people and raised expectations of a heavy crackdown on dissent.
Rebel soldiers used tanks, attack helicopters and fighter jets to try to topple Erdogan on Friday night, strafing parliament and the intelligence headquarters in Ankara while seizing a bridge and surrounding the airport in Istanbul.
The authorities rounded up nearly 3,000 suspected military plotters, including top commanders and foot soldiers, on Saturday and ordered thousands of judges detained after forces loyal to Erdogan crushed the attempted coup.
"Let's hang them!" chanted crowds in Ankara's central Kizilay square late on Saturday.
Erdogan supporters waving Turkish flags also thronged the central Taksim square in Istanbul - scene of mass anti-government protests three years ago - and a smaller crowd gathered outside the gates of the his vast presidential palace complex in the capital.
For at least eight hours overnight on Friday, violence shook Turkey's two main cities. But the coup attempt crumbled as Erdogan rushed back to Istanbul from a Mediterranean holiday and urged people to take to the streets in support of his government against plotters he accused of trying to kill him.
The violence shocked the nation of almost 80 million, once seen as a model Muslim democracy, where living standards have grown steadily for more than a decade and where the army last used force to stage a successful coup more than 30 years ago.
It also shattered fragile confidence among Turkey's allies about security in the NATO member country, a leading member of the US-led coalition against Islamic State which aspires to membership of the European Union.
Turkey had already been hit by repeated suicide bombings over the past year and is struggling to contain an insurgency by Kurdish separatists.
US President Barack Obama urged parties on all sides of the crisis to avoid destabilising Turkey and follow the rule of law. US authorities banned all airlines from flying from Turkey to the United States, citing continued security concerns, and urged US citizens to reconsider travel to Turkey.
French President Francois Hollande said on Saturday he expected there would be a period of repression in Turkey in the aftermath of the failed coup.
"They will pay a heavy price for this," Erdogan said, launching a purge of the armed forces. "This uprising is a gift from God to us because this will be a reason to cleanse our army."
He told crowds chanting for a return of the death penalty, which has been abolished, that parliament may consider such a proposal.
Hundreds of soldiers were held in Ankara for alleged involvement, leaving police stations overflowing. Among those detained was the head of the Second Army which protects the country's borders with Syria, Iraq and Iran, state-run Anadolu news agency said.
Some had to be taken under armed police escort in buses to a sports stadium. Reuters footage showed some of the detainees, handcuffed and stripped from the waist up, sitting on the floor of one of the buses.
The government declared the situation under control, saying 2,839 people had been rounded up, including "the backbone" of the rebellion.
FEARS OF CRACKDOWN
A successful overthrow of Erdogan, who has ruled the country since 2003, would have marked another seismic shift in the Middle East, five years after the Arab uprisings erupted and plunged Turkey's southern neighbour Syria into civil war.
But the failed attempt could still destabilise the US ally, which lies between Europe and the chaos of Syria.
Erdogan has blamed the coup bid on supporters of US-based cleric Fethullah Gulen, whom he has frequently accused of trying to foment an uprising in the military, media and judiciary.
Authorities began a major crackdown in the judiciary of those suspected of links to Gulen, removing from their posts and ordering the detention of nearly 3,000 prosecutors and judges on Saturday, including from top courts.
The cleric, who once supported Erdogan but became a leading adversary, condemned the attempted coup and said he played no role in it. He said the attempted overthrow may have been staged to justify a crackdown.
"As someone who suffered under multiple military coups during the past five decades, it is especially insulting to be accused of having any link to such an attempt. I categorically deny such accusations," Gulen said in a statement.
Erdogan called on the United States to extradite Gulen. US Secretary of State John Kerry said Washington was willing to help Turkey as it tries to identify those involved, but made clear it would act only if there was evidence against Gulen.
Kerry also warned that public suggestions of a US role were "utterly false" and harmful to relations after Turkey's labour minister suggested there had been US involvement in the plot.
Erdogan, who had been holidaying on the southwest coast when the coup attempt was launched, flew into Istanbul before dawn on Saturday and told thousands of flag-waving supporters at the airport that the government remained at the helm.
A polarising figure whose Islamist-rooted ideology lies at odds with supporters of modern Turkey's secular principles, Erdogan said the plotters had tried to attack him in the resort town of Marmaris.
His AK Party has long had strained relations with the military, which has a history of mounting coups to defend secularism although it has not seized power directly since 1980.
His conservative religious vision for Turkey's future has also alienated many ordinary citizens who accuse him of authoritarianism. Police used heavy force in 2013 to suppress mass protests demanding more freedom.
Erdogan commands the admiration and loyalty of millions of Turks, however, particularly for raising living standards and restoring order to an economy once beset by regular crises.
The violence is likely to hit a tourism industry already suffering from the bombings, and business confidence is also vulnerable.