ISTANBUL—Turkey plans to grant some 38,000 convicts early parole to free up space in its overcrowded prisons for tens of thousands of people accused of plotting a failed coup.

The decree, issued Wednesday, provides for the conditional release of some prisoners who have two years or less of their term left to serve, according to Justice Minister Bekir Bozdag. It will relieve Turkey’s bursting prison system, which parliamentarians and human rights groups criticized for its dire conditions even before the government’s post-coup crackdown.

Turkish authorities have been hard-pressed to find room for the 35,000 people that have been detained since the coup attempt last month that killed more than 270 people. Currently 23,400 people are in custody in connection to coup allegations, a Turkish official said.

“There have been thousands of arrests and of course there will only be more arrests. Pragmatically, they’ve decided to use this as a way of relieving the prison system,” said Senem Doganoglu, a lawyer with the Ankara-based Human Rights Association.

Officials began parole proceedings for eligible prisoners on Wednesday, state news agency Anadolu reported. Only those who committed crimes before July 1, 2016—two weeks before the coup attempt—will be eligible for parole, Mr. Bozdag said. The move won't apply to those convicted of murder, abuse, rape or terrorism, among other crimes.