Qatada has been convicted in Jordan in his absence
Islamic preacher Abu Qatada has won an appeal against deportation from the UK which could lead to him being freed.
Qatada - in prison pending deportation to Jordan - has been dubbed "Osama bin Laden's right-hand man in Europe".
The Home Office says it will challenge the ruling, and in the meantime he will remain in prison.
The Court of Appeal said it was concerned that evidence allegedly obtained under torture may form part of a future trial in Jordan.
The Jordanian national has been fighting extradition to his home country where he has been convicted for terror attacks.
The appeal panel said the Special Immigration Appeals Commission (SIAC) had misdirected itself in law over the issue of any evidence obtained by torture.
Responding to the decision, Home Office minister Tony McNulty said he believed the deportation would still go ahead.
"I am pleased that the courts dismissed all but one of Abu Qatada's reasons for appeal," he said.
"We are seeking to overturn that point, and I believe that we will be able to secure his deportation to Jordan and we will push for it as soon as possible. In the meantime, he remains behind bars."
Jordan is one of a number of countries with which the UK has signed a memorandum of understanding which ministers say will ensure that any deported terrorism suspects will not face torture or ill-treatment on return.
MEMORANDA OF UNDERSTANDING
The UK signed memoranda with Jordan, Libya and Lebanon in 2005
Their purpose is to facilitate deportation of terror suspects between countries
The Foreign Office says they act as assurances from those countries that suspects sent back will not be tortured
Critics say the agreements are neither binding nor offer suspects any protection
Shadow Home Secretary David Davis criticised the government's approach, saying it should concentrate on prevention and prosecution as well as trying to deport individuals once in the UK.
He said: "They should answer our calls to establish a dedicated UK border police to secure our borders and prevent foreign terror suspects from entering the country in the first place."
Liberal Democrat home affairs spokesman Chris Huhne said the court was rightly concerned about the use of evidence gained under torture in Jordan, which would not be admissible in a British court.
He said Qatada should now be charged in the UK courts, or released.
Gareth Peirce, Qatada's solicitor, said she welcomed the court's decision but criticised the memorandum of understanding, saying it was "unenforceable" and carried "no possible sanction or redress if breached".
Human rights group Amnesty International called for Qatada to be "fairly tried - not shipped off to Jordan to be sentenced on the basis of evidence that was tortured out of someone".
In a separate ruling on Wednesday, the three appeal judges also found in favour of two Libyan suspects, after the government appealed another decision by Siac.
Siac had ruled that the pair faced a risk of ill-treatment, including torture, if they were returned to Libya.
Qatada made a video appeal to the kidnappers of Norman Kember
As a result of the appeal court ruling, deportation proceedings against 10 other Libyan nationals have effectively been abandoned.
A Home Office spokesman said the government would not appeal against the judgment in this case.
Abu Qatada became one of the UK's most wanted men in December 2001 when he went on the run on the eve of government moves to introduce new anti-terror laws allowing suspects to be detained without charge or trial.
In October 2002 the authorities tracked him down to a council house in south London and took him to Belmarsh Prison.
He was eventually freed on bail in March 2005, but was made subject of a control order to limit his movements.
In August that year he was taken back into custody pending extradition to Jordan.