A federal judge declined Tuesday to release a Guantanamo Bay prisoner who was arrested after the Sept. 11, 2001, attacks with a suspected terrorist leader but claimed he was the victim of mistaken identity.

U.S. District Judge Richard Leon ruled there is plenty of evidence that 40-year-old Algerian Abdal Razak Ali was part of a fighting force formed by al-Qaida ally and facilitator Abu Zubaydah and can continue to be held at the prison on the U.S. Navy base in Cuba after more than eight years of detention.

Razak Ali's attorney, Candace Gorman, denied that he engaged in any terrorist activity and says witnesses who claim otherwise misidentified him and in some cases were tortured. As Leon was preparing his opinion in the case over the holidays, the government withdrew its reliance on a witness who had identified Razak Ali because of information about the witness' credibility.

Gorman acknowledged her client was captured along with Abu Zubaydah and dozens of others at a guest house in Faisalabad, Pakistan on March 28, 2002, but said her client did not know Abu Zubaydah and only went there to escape an anti-Arab climate in Pakistan after the Sept. 11 attacks.

U.S. officials say Abu Zubaydah was a terrorist affiliated with Al-Qaida and helped plot the USS Cole bombing. Leon said it's an "obvious and common-sense inference that a terrorist leader like Abu Zubaydah would not tolerate an unknown and untrusted stranger to dwell in a modest, two-story guesthouse for two weeks with himself and ten or so of his senior leadership while they are preparing for their next operation against U.S. and allied forces."

Leon said their capture together at the house containing al-Qaida literature and a device often used to assemble roadside bombs would be enough alone to continue detaining him. But Leon said prosecutors also offered credible accounts from witnesses that said Razak Ali was receiving training in English at the guest house and traveled with the Abu Zubaydah fighters from Afghanistan _ both claims that the detainee denied.

Most of the evidence in the case was classified and discussed during several days of hearings last month that were closed to the public. But Leon read an unclassified version of his ruling in open court.

Razak Ali was taken to Bagram Air Base in Afghanistan after his capture and transferred to Guantanamo Bay in June 2002, where he has remained since without being charged with a crime.

Although the court documents refer to the detainee as Abdal Razak Ali, one of several names he has used, Leon's ruling notes that he now says his name is Saeed Bakhouche.