President Erdogan has been warned not to use the failed coup in Turkey as a “blank cheque” to bypass democratic principles.

Six thousand people have been arrested over the uprising amid growing fears the government will use the attempted putsch as a cover for cracking down on legitimate dissent.

High-ranking soldiers and 2,700 judges are among those to have been detained following clashes in which 265 people were killed.

President Recep Tayyip Erdogan has said that parliament will consider introducing the death penalty to deal with those believed to have committed traitorous acts against the state.

Mr Erdogan spoke to his supporters in front of his Istanbul residence on Sunday evening.

His speech was punctuated by frequent calls of "we want the death penalty" from the large crowd, to which Mr Erdogan responded: "We hear your request. In a democracy, whatever the people want they will get."

Adding that they will be in contact with Turkey's opposition parties to reach a position of capital punishment, he said: "We will not delay this decision for long. Because those who attempt a coup in this country must pay."

Turkey has not executed anyone since 1984 and capital punishment was legally abolished in 2004 as part of its bid to join the European Union.

In pictures: Turkey coup attempt Show all 17 1 /17 In pictures: Turkey coup attempt In pictures: Turkey coup attempt Turkish President Erdogan attends the funeral service for victims of the thwarted coup in Istanbul at Fatih mosque on July 17, 2016 in Istanbul, Turkey Burak Kara/Getty Images In pictures: Turkey coup attempt Soldiers involved in the coup attempt surrender on Bosphorus bridge with their hands raised in Istanbul on 16 July, 2016 Gokhan Tan/Getty In pictures: Turkey coup attempt A civilian beats a soldier after troops involved in the coup surrendered on the Bosphorus Bridge in Istanbul, Turkey, 16 July, 2016 REUTERS/Murad Sezer In pictures: Turkey coup attempt Surrendered Turkish soldiers who were involved in the coup are beaten by a civilian Reuters In pictures: Turkey coup attempt Soliders involved in the coup attempt surrender on Bosphorus bridge Getty In pictures: Turkey coup attempt Supporters of Turkish President Recep Tayyip Erdogan wave flags as they capture a Turkish Army vehicle Getty In pictures: Turkey coup attempt People pose near a tank after troops involved in the coup surrendered on the Bosphorus Bridge in Istanbul, Turkey, 16 July, 2016 Reuters In pictures: Turkey coup attempt Turkish soldiers block Istanbul's Bosphorus Brigde Getty In pictures: Turkey coup attempt A Turkish military stands guard near the Taksim Square in Istanbul Reuters In pictures: Turkey coup attempt Pierre Crom/Twitter In pictures: Turkey coup attempt Turkish soldiers secure the area as supporters of Recep Tayyip Erdogan protest in Istanbul's Taksim square AP In pictures: Turkey coup attempt People demonstrate in front of the Republic Monument at the Taksim Square in Istanbul Murad Sezer/Reuters In pictures: Turkey coup attempt Turkish soldiers detain police officers during a security shutdown of the Bosphorus Bridge Reuters In pictures: Turkey coup attempt Turkish Army armoured personnel carriers in the main streets of Istanbul Getty In pictures: Turkey coup attempt Chaos reigned in Istanbul as tanks drove through the streets EPA/TOLGA BOZOGLU In pictures: Turkey coup attempt Turkish President Tayyip Erdogan speaks to media in the resort town of Marmaris Reuters In pictures: Turkey coup attempt Supporters of President Erdogan celebrate in Ankara following the suppression of the attempted coup Reuters

And Turkey's prime minister, Binali Yildirim, said that life was returning to normal and urged supporters to remain on the streets to show their support for the government.

He also issued a stark warning to opponents: “Another calamity has been thwarted. However, our duty is not over. We shall rapidly conduct the cleansing operation so that they cannot again show the audacity of coming against the will of the people.”

Addressing tens of thousands on the sreets who were chanting “We want the death penalty! We want the death penalty!”, Mr Yildrim told protestors: “We got your message. The necessary will be done.”

Speaking to television channel France 3, France’s foreign minister Jean-Marc Ayrault urged Turkish leaders to rule within the boundaries of the law.: “[The coup] is not a blank cheque for Mr Erdogan. There cannot be purges, the rule of law must work.”

He added European ministers meeting on Monday in Brussels would reiterate that Turkey had to conform to Europe’s democratic principles.

The coup, which was launched on Friday night by members of the military, has also increased tensions with the US, with Turkey's leader demanding the extradition of a US-based cleric accused of orchestrating the violence.

On Sunday, President Erdogan vowed to “clean all state institutions of the virus” of Fethullah Gulen supporters.

He said Turkey, through the justice ministry and foreign ministry, would request the extradition of the cleric, who is based in the United States, and his backers.

Earlier, Mr Yildirim warned Barack Obama that “any country that stands behind him is no friend of Turkey, is engaged in a serious war with Turkey”.

“Today, after this coup attempt, I’m once again calling on you, I’m saying: extradite this man in Pennsylvania to Turkey now,” he added.

Suleyman Soylu, Turkey's labour minister, went further than Erdogan, suggesting the US was behind the coup. “The US is behind the coup attempt. A few journals that are published there [in the US] have been conducting activities for several months. For many months we have sent requests to the US concerning Fethullah Gulen. The US must extradite him,” he said.

At a news conference on Saturday in Saylorsburg, Pennsylvania, Mr Gulen strongly denied any role in or knowledge of the coup.

“Government should be won through a process of free and fair elections, not force,” he said.

“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.”

US Secretary of State John Kerry said the United States would entertain an extradition request for Mr Gulen, but Turkey would have to present legitimate evidence that withstands scrutiny.

The country’s Justice Minister, Bekir Bozdag, has also warned that the number of those likely to be arrested will continue to rise. “The clean-up operations are continuing,” he said.

On Sunday, the commander of the Incirlik Air Base in southern Turkey that is used by the US and other coalition partners was detained for complicity in the attempted coup, a government official said.

Incirlik is used by the United States and other coalition partners in the fight against Isis militants in Syria.