The Royal Courts of Justice in London, where the high court is situated.
Photograph: Andrew Matthews/PA Images

The high court in London has refused to return an absconding British prisoner to Turkey on the grounds that the country’s jails are so overcrowded they are unsafe following the 2016 attempted coup.

The decision – the latest in a series of extradition setbacks inflicted by British judges – is diplomatically embarrassing for a fellow member of Nato and sets a significant legal precedent.

The latest ruling follows a direct request made during a visit last year by the Turkish prime minister, Binali Yıldırım, to Theresa May. He sought the extradition of fugitive businessmen and activists living in Britain who were allegedly involved in the 2016 failed military coup in Ankara and Istanbul, which the Turkish government estimates involved 60,000 conspirators.

That plea received a muted response from Downing Street, which told Yıldırım that action would only be taken if there was credible evidence of criminal wrongdoing by an individuals in the UK.

MPs on the foreign affairs select committee have condemned the Turkish president, Recep Tayyip Erdoğan, for using the failed July 2016 coup to purge opponents and suppress human rights. Tens of thousands of teachers, lawyers, police officers, judges and other officials and citizens have been removed from their posts or detained.

The latest high court case involved a 41-year-old man who holds joint Iranian and British nationality. He came to the UK in 2002 to attend a kick-boxing tournament and was eventually granted asylum. His home is in London where he lives with his second wife and two children.

In February 2011, returning from a family visit to Iran, he was stopped in his car at the Turkish border where 33kg (72.7lbs) of the synthetic drug MDMA was discovered concealed beneath the back seat.

The man, who has been granted anonymity because of his poor mental health and his claim that he was subsequently raped by Turkish inmates, insisted he knew nothing about the drugs. He said they were hidden without his permission when he lent the car to a friend in Iran for a wedding.

Despite his denial, a Turkish court sentenced him to seven and a half years in prison. After serving three years in a closed prison in Edirne, he was supposed to be transferred to an open prison but escaped because he was not accompanied on the trip by guards.

The appellant’s lawyers, David Josse QC and Ben Keith, told the court that human rights conditions in Turkey were deteriorating following the attempted coup and Turkey refused to allow independent inspectors to investigate its prisons.

Dismissing the extradition request, Lord Justice Holroyde said he was not making a general assessment of Turkish prison conditions but “taking into account the risk of suicide, a failure to meet the mental healthcare needs of the appellant would” breach his rights under article 3 of the European convention on human rights, which outlaws torture or inhuman or degrading treatment.

The risk, the judge said, was that he would be in danger of “violence by other prisoners which the prison guards either could not control (perhaps because of lack of resources) or would choose to ignore”.

Holroyde added: “It is not the attempted coup in itself which is relevant in the particular circumstances of this case: it is the subsequent prison overcrowding.”

Responding to the judgment, Renata Pinter, of the law firm Dalton Holmes Gray, which represented the man, said: “This case has been a long battle and has shown how far human rights and the rule of law have deteriorated since the attempted coup in Turkey. The prisons are hugely overcrowded and Turkey are not allowing access to independent inspectors.”