The Turkish government is considering bringing back the death penalty so it can execute those involved in the attempted military coup against President Recep Tayyip Erdogan.

Mehmet Müezzinoğlu, the ruling Justice and Development Party's Deputy Leader, said the government will introduce a bill calling for the execution of rebel soldiers.

“We will put forward a motion, which will demand the execution of those who have been involved in the coup attempt," Mr Müezzinoğlu wrote on Twitter.

Following his comments, #Idamistiyorum ("I want death penalty") has become the top trend on Twitter in Turkey. The hashtag has been used more than 23,000 times.

The call for the death penalty came as the government appeared to be regaining control after a coup which left more than 260 dead and 1,000 wounded.

Violence between protesters and police in Turkey

At one point it looked as if the coup would succeed, with Turkey’s military chief of staff General Hulusi Akar having been taken hostage and a TV news anchor forced to keep repeating: “The political administration that has lost all legitimacy and has been forced to withdraw.”

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

President Erdogan appeared to have been caught off guard while on holiday. He had to resort to giving interviews via mobile phone and FaceTime to insist he was still in control.

But citizens took to the streets in support of the president, lying down in front of tanks or climbing on top of them in Istanbul.

Mr Erdogan succeeded in returning to Istanbul, and General Akar was reportedly rescued after an operation at an air base on the outskirts of the capital Ankara.