The numbers game is intriguing. There were 187,000 prisoners in Turkey’s jails back in March. Since the failed coup in mid July, the cops have picked up, imprisoned or “detained” for interrogation at least 23,000 soldiers and civilians, judges, journalists, teachers and civil servants. The figure may be as high as 32,000, even 35,000.

And now, out of the blue, Recep Tayyip Erdogan’s government empties from its jails 38,000 inmates who have been in clink since before 1 July; in other words, criminals who could not have participated in the attempt to overthrow Erdogan 14 days later.

So 38,000 convicts walk out of their cells to make way for the Sultan’s new batch of prisoners. The government insisted this was no amnesty; which, of course, it was, since there appears to be no system of ensuring that newly-released inmates will not repeat their offences. Incredibly, the release decree was described as part of a “penal reform” across the country’s 364 jails.

Turkey’s failed coup strains relations with the West

It’s also an interesting reflection not only on the ease with which Turkey can free its prison population – albeit that inmates guilty of serious crime such as murder or rape will not benefit – but also of how one major political crisis can so swiftly overwhelm the country’s security system.

When the Turkish army itself staged a coup in 1980, the prison capacity had to be raised from 55,000 to 80,000 to accommodate a vast selection of new “security” detainees. These mostly male prisoners, from the far left and far right in Turkey and who participated in what was largely regarded as an incipient civil war, languished for many years, often without trial. There is no reason to suppose that the next lot of inmates will fare much better for their supposedly Gulenist crimes.

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

Already made infamous by the depiction of corruption and sadism in the movie Midnight Express, Turkey’s jails have a sinister reputation for cruelty that goes back to the Ottoman days. The country’s most famous prisoner, the Kurdistan Workers Party leader Abdullah Ocalan, will presumably continue to endure his eight-and-a-half-year incarceration on Imrali island in the Sea of Marmara in solitary confinement.

While his followers have often filled Turkey’s prisons in the south-east of the country – especially in Diyarbakir – the ferocious battles in which they have been engaged by the Turkish army have been so bloody that they appear to have produced more dead bodies than prisoners. More than 21,000 Kurds are believed to have been killed between 1984 and 2012, and another 2,000 between July and September last year.