Turkey has issued a decree for the conditional release of 38,000 prisoners in an apparent move to make space for thousands of people arrested as part of an investigation into last month's failed coup.

The decree, announced by the country's justice minister, allows the release of inmates who have two years or less to serve of their sentences.

It also makes convicts who have served half their prison term eligible for parole.

However, those convicted of murder, domestic violence, sexual abuse or terrorism and other crimes against the state will be excluded.

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

The measures will not apply for crimes committed after 1 July, excluding any people later convicted of involvement in the 15 July coup.

Justice Minister Bekir Bozdag said on his Twitter account that the measure would lead to the release of around 38,000 people.

He also insisted it was not a pardon or an amnesty, but a conditional release of prisoners.

The government has said the failed putsch, which led to at least 270 deaths, was carried out by followers of the movement led by US-led Muslim cleric Fethullah Gulen who infiltrated the military and other state institutions.

Mr Gulen has denied any involvement in the coup but Turkey is demanding the United States extradite him.

More than 26,000 have been detained by the Turkish government and a further 8,000 remain under investigation, according to the country's Justice Minister.