A British court on Wednesday ordered the release of a Moroccan man allegedly linked to the Sept. 11, 2001, attacks in the United States.

Farid Hilali has been held in British prisons for 2 1/2 years while fighting against a Spanish extradition warrant.

Justice Janet Smith and Justice Stephen Irwin ruled that Hilali's detention under a European arrest warrant had become arbitrary and unjustified.

Hilali was not immediately released, however, pending an appeal to the House of Lords.

Hilali was arrested in Britain in June 2004 on terrorism charges after he was named with 34 others — including Al Qaeda leader Usama bin Laden — as an alleged conspirator in the 2001 attacks.

Spanish authorities sought the extradition of Hilali because of his links to Syrian-born Spaniard Imad Yarkas, who is alleged to have founded and led an Al Qaeda cell in Spain.

Hilali was alleged to have been recorded telling Yarkas he had "entered the field of aviation" and spoke of "cutting the bird's throat" — an apparent reference to the American national symbol of a bald eagle, prosecutors said.

Muddassar Arani, Hilali's lawyer, accused Spanish authorities of abusing the European arrest warrant.

"We argued that the courts in one EU country have to trust the courts of another, and this judgment today demonstrates how important it is that that trust is not abused, and that courts who request extradition should act openly and in good faith," Arani said.

"No explanation has been tendered, in spite of numerous requests by me and my firm, as to why the Spanish authorities have obstinately proceeded with a dud case. Why criminal proceedings have not been taken in London has never been explained," Arani said.

Spanish Judge Baltasar Garzon has said that Hilali was a suspect identified by the code name Shakur. Under that alias, Hilali was indicted in September 2003 in Spain.

Garzon said he had issued that indictment because Al Qaeda used Spain as a base to plot the Sept. 11 attacks.