The high court has dismissed the government’s claim that Britain’s relations with the US would be damaged if a Pakistani citizen who says he was tortured by British and American troops was allowed to sue for damages in court.

British courts would be failing in their duty if they did not deal with the claims even if that involved the court finding that US officials acted unlawfully, Mr Justice Leggatt ruled on Wednesday.

“If it is necessary to adjudicate on whether acts of US personnel were lawful … in order to decide whether the defendants violated the claimant’s legal rights, then the court can and must do so,” he said.

He added: “For the court to refuse to decide a case involving a matter of legal right on the ground that vindicating the right would be harmful to state interests would seem to me to be an abdication of its constitutional function.”

Yunus Rahmatullah says he was tortured over a 10-year period after being captured by British special forces in Iraq and handed over to US troops in 2004. He was released by the US without charge in May.

The ruling also affects claims made by three Iraqi men of abuse by British soldiers at various detention facilities in Iraq prior to handover to US forces. One of the men alleges he suffered severe sexual abuse at the notorious Abu Ghraib prison, after his handover to the US.

Sapna Malik of law firm Leigh Day, which represents Rahmatullah, said: “It is now high time for the British government to abandon its attempts to evade judicial scrutiny of its conduct in operations involving the US in Iraq and Afghanistan so that justice may finally be served for what has passed and lessons learned for the future.”

Wednesday’s ruling comes in the wake of a recent appeal court ruling that a separate rendition case – brought by Libyan politician Abdel Hakim Belhaj, and his wife, Fatima Bouchar, against former foreign secretary Jack Straw and MI6 – should be heard in the British courts, despite similar claims by the government that to do so would damage US-UK relations.

The Libyan couple were abducted and secretly rendered to Tripoli in a joint MI6-CIA operation in 2004. They say in detailed court statements that they were tortured by Muammar Gaddafi’s security forces.

The court of appeal ruled last month: “There is a compelling public interest in the investigation by the English courts of these very grave allegations. The risk of displeasing our allies or offending other states … cannot justify our declining jurisdiction on grounds of act of state over what is a properly justiciable claim.”

In both the Rahmatullah and Belhaj cases, the Ministry of Defence and the Foreign Office say the doctrines of state immunity and “foreign act of state” should prevent the courts from hearing claims for compensation and declaring that the British government was responsible for their unlawful treatment.

Government lawyers have indicated they will challenge the judgments in the supreme court. Last year the supreme court described Rahmatullah’s treatment by UK and US forces as unlawful and a possible war crime.

“The, presumably forcible, transfer of Mr Rahmatullah from Iraq to Afghanistan is, at least prima facie, a breach of article 49 [of the fourth Geneva convention],” it said.

Kat Craig, a director of the legal charity Reprieve, which is also representing the Pakistani, said: “Yunus Rahmatullah suffered some of the most shocking abuses of the ‘war on terror’. Now we know the government’s attempt to avoid accountability for his ordeal is without merit … The government must accept this, and be prepared to answer for its past actions.”