A radical Muslim cleric once described as "Osama bin Laden's right-hand man in Europe" will be freed within days.
Abu Qatada will be on the streets and walking his child to school next week despite the fact the Home Secretary considers him "a real threat to our security".
He has been held for six-and-a-half years, more than "any other detainee in modern immigration history", while fighting deportation to Jordan.
But he will be released from the maximum security prison where he is being held after applying for bail when human rights judges in Europe ruled he could not be deported without assurances from Jordan that evidence gained through torture would not be used against him.
Mr Justice Mitting, president of the Special Immigration Appeals Commission (Siac) which considered his case, said that while his detention to date had been justified, "the time will arrive quite soon when continuing detention or deprivation of liberty" would have to stop.
Ruling that Qatada should be "bailed on highly prescriptive terms", he gave Home Secretary Theresa May three months to show that British diplomats were making progress in negotiations with Jordan or risk seeing Qatada's bail conditions removed.
He added that the bail conditions would be similar to the tough terms set in May 2008 because the "risks to national security and of absconding are not significantly changed".
The radical cleric "has shown no inclination of any change in attitude", the judge said.
Qatada must stay at a home address, which will be checked by MI5 over the next few days before he can be released from the high security Long Lartin jail in Worcestershire next week. He will be allowed to leave his home for only two one-hour periods, Mr Justice Mitting said.
Shadow home secretary Yvette Cooper called for Mrs May "to explain urgently what action she is taking on the national security implications of this judgment".