A man security services say was the leading figure in "a close group of Islamic extremists based in north London" must be moved out of the capital to protect the public, the High Court ruled today.
The man, who is subject to a control order and can only be referred to as "CD", has attempted to obtain firearms, according to intelligence reports.
CD was reported to have attended the training camp organised by Muhammed Hamid, and also attended by the 21/7 bombers, at Baysbrown Farm in Cumbria in May 2004.
Today Mr Justice Simon said CD's removal to an undisclosed address "in a Midland city" was "a necessary and proportionate measure to protect the public from the risk of what is an immediate and real risk of a terrorist-related attack".
The risk was "significant", notwithstanding the high level of protection implicit in his control order obligations.
It was the Home Office case that relocation was necessary to prevent covert meetings with his associates in London to plan attacks.
CD, who has dual British and Nigerian nationality, was served with a control order in February this year.
The 12-month order was imposed following Government assertions that putting him on trial risked revealing intelligence sources.
Today his appeal against being banned from the capital was rejected at London's High Court.
Lisa Giovannetti QC, for the Home Secretary, had told the court there was evidence of CD attending "numerous covert meetings" with two associates, referred to as MS and TM, up to October 2010.
The security services assessed these as being for the purpose of "enabling the three of them to develop the group's attack plans".
MS had voluntarily moved to an address outside the capital, but he was still free to travel to the city whenever he wished.
CD had gone to Syria in late 2005 and undertaken extremist training whilst there and returned to the UK in April 2009.
Ms Giovannetti said there had been several attempts to procure firearms since his return to the UK, from seven named north London-based criminal associates. CD had also shown "a very high level of security awareness".
John Burton QC, appearing for CD, said his client had not denied his association with Muhammed Hamid. He had not been arrested or charged in relation to attendance at the training camp in 2004.
CD had not sought to conceal his extremist Islamist views.
Mr Burton questioned why it became necessary in February to relocate him when he had been "subject to close attention" since 2004 in north London and subjected to a large number of restrictions.
The London ban was having a "devastating" impact both psychologically and physically.
Rejecting CD's appeal, the judge said: "There is evidence which supports the conclusion that CD has a background and training which would lead to a justifiably held fear that he would engage in terrorist-elated activity based on his strongly held Islamist views."
That by itself did not justify his forced relocation, said the judge.
"However, since his return (from Syria) he has endeavoured to obtain firearms on a number of occasions from a number of associates for the purposes of putting into effect a planned terrorist attack, has held covert meetings with associates in relation to plans to use the firearms as part of his planned attack and has displayed a very high level of security awareness."
There were concerns over "his ability to evade the attentions of those who have a duty to prevent him putting his plans into effect, in so far as they are able."