The British government on Wednesday vowed to continue its fight to deport radical Islamist cleric Abu Qatada to Jordan after failing in its latest attempt to have him expelled.
Lawyers for Home Secretary Theresa May lost their appeal against a decision by the Special Immigration Appeals Commission (SIAC) in November to allow the Jordanian to stay in Britain.
Three judges at the Court of Appeal acknowledged that ministers believed Abu Qatada to be an "exceptionally high-risk terrorist" but said this was not relevant to their considerations.
The Home Office or interior ministry vowed to keep fighting, saying in a statement: "This is not the end of the road. The government remains determined to deport Abu Qatada."
It said ministers planned to seek leave to appeal, further dragging out a case that has been a thorn in the side of successive British governments for the past decade.
Abu Qatada meanwhile remains in custody. He was released on bail following November's decision, but was sent back to jail earlier this month for breaching the conditions of his release.
The 52-year-old cleric, whose real name is Omar Mohammed Othman, has been convicted of terrorism offences in Jordan in his absence and is likely to face a retrial if and when he is sent back.
But he has successfully fought off attempts at deportation since 2005 by arguing that his human rights would be violated if he was returned to Jordan.
The cleric, who first arrived in Britain in 1993 claiming asylum, was once branded the right-hand man in Europe of Osama bin Laden, although he denies ever having met the late Al-Qaeda leader.
In November, SIAC ruled there was a real risk that evidence obtained through torture would be used against Abu Qatada in any retrial, which it said would be a "flagrant denial of justice".
This was despite the British government having sought assurances about his treatment from Jordan to overcome similar objections raised by the European Court of Human Rights 10 months earlier.
Government lawyers were given leave to appeal November's decision but only on a point of law, and the judges said on Wednesday they had failed to prove that there were legal mistakes in the SIAC ruling.
"We are satisfied that SIAC did not commit any legal errors. This appeal must therefore be dismissed," the ruling said.
The judges acknowledged ministers' frustration, but said: "The fact that Mr Othman is considered to be a dangerous terrorist is not relevant to the issues that are raised on this appeal."
The Home Office said it would consider the ruling carefully and planned to seek leave to appeal.
"In the meantime we continue to work with the Jordanians to address the outstanding legal issues preventing Abu Qatada's deportation," it said.
Yvette Cooper, the home affairs spokesman for the opposition Labour party, said the ruling made a mockery of the government's repeated assurances that Abu Qatada would soon be on a plane.
"The home secretary needs to pursue all legal avenues, demonstrate further work with Jordan, take urgent action to keep the public safe, and get this deportation back on track," she said.
In a hearing on March 11, government lawyers argued that SIAC had taken an "erroneous" view of the situation in Jordan, insisting the constitution there clearly banned the use of evidence obtained through torture.
But Abu Qatada's lawyer Edward Fitzgerald argued there was "concrete and compelling evidence" that Abu Qatada's co-defendants were tortured into providing statements.
Britain initially detained Abu Qatada in 2002 under anti-terror laws imposed in the wake of the September 11 attacks on the United States in 2001, and he has been in and out of jail ever since.
The cleric was released under house arrest in November but was sent back to jail on March 9 accused of breaching his bail conditions.