Turkey will grant early release to some 38,000 prisoners who committed crimes before July 1, Justice Minister Bekir Bozdag has said, to make room for the tens of thousands of detentions made in connection with last month's failed coup attempt.

According to decrees published on Wednesday, the release will not apply to convicts guilty of murder, sexual crimes, "terrorism" or state security crimes, or to the thousands jailed after the July 15 attempted coup.

The government decree, issued under Turkey's three-month long state of emergency, allows the release of inmates who have two years or less to serve of their prison terms. It also makes convicts who have served half of their prison terms eligible for parole. 

President Erdogan and opposition unite in Turkey rally

In a series of messages posted on Twitter on Wednesday, Bozdag said the move was "not an amnesty", and that convicts were not being pardoned but released on parole.

"The regulation refers to crimes committed before July 2016. The crimes committed after July 1 2016 are outside its scope," Bozdag said.

"As a result of this regulation, approximately 38,000 people will be released from closed and open prisons at the first stage."

Reports of overcrowding

The government says the attempted coup was carried out by followers of a movement led by US-based Muslim cleric Fethullah Gulen who have infiltrated the military and other state institutions.

Gulen has denied any prior knowledge or involvement in the coup but Turkey is demanding that the United States extradite him.

The Turkish government has launched a massive overhaul ostensibly aimed at Gulen's supporters in the aftermath of the coup attempt.

Some 35,000 people have been held for questioning, and more than 18,000 of them have been formally arrested to face trial, including soldiers, police, judges and journalists.

Nearly 11,500 have since been released and 5,500 remain in custody, an official source told Al Jazeera.

Tens of thousands of others with suspected links to Gulen have been suspended or dismissed from their jobs in the judiciary, media, education, health care, military and local government.

READ MORE: How will the military shake-up affect Turkey's future?

In a separate decree, also issued on Wednesday, the government dismissed another 2,360 officers from the police force, in addition to another 136 military officers and 196 employees from its information technology authority.

Wednesday's decrees also allow the air force to hire new pilots or take back staff who had resigned or were discharged before the coup attempt to replace pilots who have been arrested or dismissed for alleged participation in the July 15 events or links to Gulen.

The moves by the Turkish government have raised concerns among European nations and human rights organisations, who have urged Ankara to show restraint.

Turkey's 180,000-person prisons were already filled to capacity before the crackdown on Gulen's movement, with some rights groups claiming that inmates were forced to take turns to sleep on beds.

Turkey has issued several prison amnesties over past decades to ease conditions in its prisons, but the measures proved unpopular with the public..

Source: Al Jazeera and agencies