Muslim cleric Abu Qatada will not now be deported from Britain to Jordan, where he is accused of plotting bomb attacks. His lawyers had argued he would not get a fair trial in Jordan.
An appeal to the Special Immigration Appeals Commission has been upheld, though the British government says it will now seek to appeal against that.
Abu Qatada was once described by a Spanish judge as Osama bin Laden's right-hand man in Europe.
Judges at the European Court in Strasbourg ruled early in 2012 that the cleric would not face ill-treatment if returned to Jordan.
They said a UK-Jordan agreement over Mr Qatada's treatment, called a Memorandum of Understanding, was sound and met European standards of humane treatment.
However, the BBC reports the judge did not believe he would get a fair trial because a Jordanian court could use evidence against Abu Qatada that had been obtained from the torture of others.
Abu Qatada has been subject to lengthy periods of detention since 2001. He will be released from Long Lartin prison in Worcestershire on Tuesday.