Britain: An Algerian terror suspect cannot be deported after a judge ruled he is not a threat to national security
Moloud Sihali, previously cleared of taking part in an alleged poison plot, had faced return to his home country.
He said he could face torture if sent back under a controversial deal between the UK and Algerian governments.
The Special Immigration Appeals Commission said ministers could appeal their decision - but also ruled three other Algerians should be deported.
Mr Sihali, 30, was cleared in 2005 by a jury at the Old Bailey of taking part in an alleged terrorist conspiracy to spread the poison ricin in London.
He was later placed under restrictive bail conditions amounting to a form of house arrest while he mounted legal challenges to the Home Office's attempts to deport him.
In a judgement at SIAC, Mr Justice Mitting ruled Mr Sihali was not a threat to national security and should not be deported under a special arrangement between the UK and Algeria for terrorist suspects.
Mr Justice Mitting relaxed the bail conditions while giving the Home Office 10 days to appeal.
Three other Algerians lost appeals against deportation. The first man, known only as U, is already appealing. Lawyers for the other men, W and Z, are considering whether there are separate grounds for an appeal.
The ricin case timeline