Radical Muslim cleric Abu Qatada has won a last-minute appeal against deportation from Britain to face terrorism charges in Jordan, a blow to the Conservative-led government that says he is a huge security risk.
Britain, where Qatada has been in and out of jail for seven years without charge since his arrest in 2002, had argued that a 2005 deal with Jordan and more recent diplomatic assurances would ensure that Qatada would obtain a fair trial there.
Qatada said his trial might be skewed by evidence obtained using torture, a claim upheld in a ruling by the European Court of Human Rights.
He will be released under bail conditions that include a 16-hour curfew at his London home.
A Jordanian of Palestinian origin, described by a Spanish judge as "Osama bin Laden's right-hand man in Europe", he has been a thorn in the side of successive British governments.
Britain says videos of his sermons influenced Mohammed Atta, the ringleader of the September 11, 2001 attacks on the United States.
The ruling, delivered at a special court that deals with security cases, said Home Secretary Theresa May had been wrong not to revoke an earlier deportation ruling against Qatada, and allowed his appeal.
The decision is a setback for May and the government, both keen to foster an image of competence and decisiveness on security issues.
Jordan has convicted him in his absence of encouraging militants there who were planned bomb attacks in 1999 and 2000.
May's department said in a statement it strongly disagreed with the ruling and would seek leave to appeal.
Robin Tam, a lawyer for the British government, told the court that Qatada "remains a man who poses an enormous risk to national security".
Britain's failure to deport Qatada contrasts with its success last month in extraditing to the US another radical cleric, Abu Hamza, who fought deportation for eight years.