Turkey could draft a “limited measure” of the death penalty, prime minister Binali Yildirim has said, if an agreement can be made between political parties.

“If there is an agreement on capital punishment, there could be a limited measure. We will not close our ears to the demands of the people,” he said in a speech to members of his ruling AK Party in parliament on Tuesday.

No executions have been carried out in Turkey since 1984 and the country formally abandoned the punishment in 2002 as part of its preparation for its European Union accession process.

Germany and EU member states have made it clear to Turkey that reinstating the death penalty would spell an end to the country’s bid to become a part of the EU in July, following President Recep Tayyip Erdogan raising the possibility of bringing back the punishment following the failed coup.

Just three days ago president Erdogan said he would ask parliament to reconsider reinstating the death penalty, stating that he was “convinced” parliament would approve it and that he would then ratify it.

Nearly 35,000 people have been arrested in Turkey and more than 100,000 people have been dismissed or suspended from government jobs since the failed coup in a bid to stamp out US-based cleric Fethullah Gulen’s network, who has been blamed by Ankara for orchestrating the failed coup.

Turkey’s failed coup strains relations with the West

Prime minister Yildirim appeared to say that none of those who have been detained so far would be able to face capital punishment however, saying it would not be able to apply it “retroactively”.

“We want it to be known that this won’t be done by us alone and the measure would not apply retroactively,” he said.

The prime minister also shrugged off criticism from the EU on Turkey’s curb on media freedoms after 15 more media outlets were closed over what were called suspected links with terrorist organisations and Mr Gulen.

At least 13 senior staff members of an opposition newspaper were also detained and a further 10,000 civil servants have been dismissed.

Mr Yildirim said that Turkey would not be taught lessons by Europe and that the government would “protect press freedom until the end”.