A Moroccan man accused of being linked to the 11 September US attacks has won his High Court bid for freedom.
High Court judges called his imprisonment unjustified
Lawyers for Farid Hilali, 36, who was first arrested in the UK in 2003, were granted a writ of habeas corpus to obtain his release.
He was awaiting extradition to Spain on charges of conspiracy to murder.
Lady Justice Smith and Mr Justice Irwin ruled that his incarceration under a European arrest warrant was arbitrary and unjustified.
However, Mr Hilali will not be freed until a decision has been made by law lords about whether or not they will hear the case.
The charges were based on accusations that he was party to a conspiracy in Spain linked to and supportive of the 9/11 attacks on the US.
Mr Hilali was originally arrested in September 2003 in Kennington, south London, under the Terrorism Act 2000 and subsequently held on immigration charges.
He was being held in Whitemoor prison in Cambridgeshire.
The judges ruled that his current detention "is unlawful and a writ of habeas corpus must be issued".
The Crown Prosecution Service and Spanish authorities were refused leave to appeal, but the CPS is considering petitioning the House of Lords directly.
The High Court judges also refused to grant him bail in advance of any further court hearing while his immigration status remains unsettled.
They said they had reason to fear he might abscond and that he had used false documents in the past.
Muddassar Arani, Mr Hilali's solicitor, said: "If the authorities have any evidence against Mr Hilali, let them charge him, and bring him before a British jury, rather than his already excessive imprisonment without trial for many months more."
The US criminal justice authorities "have never sought his extradition, and do not believe there is any evidence against him", he added.