An appeals court on Thursday upheld the conviction of an ex-Guantanamo detainee in the 1998 bombings of two U.S. embassies in Africa, in a boost to U.S. efforts to gain intelligence from terrorism suspects before prosecuting them.

Ahmed Khalfan Ghailani served as Osama bin Laden’s cook and bodyguard after the al-Qaida suicide bombings in Tanzania and Kenya. The 2nd U.S. Circuit Court of Appeals rejected arguments that his long detention overseas by the Central Intelligence Agency violated his constitutional right to a speedy trial. It concluded that he was properly convicted and sentenced to life in prison for his role in the attacks that killed 224 people, including a dozen Americans.

Ghailani’s lawyer, Peter Quijano, promised a Supreme Court appeal. Ghailani had claimed he was tortured at a secret CIA detention site after his arrest in Pakistan in 2004.

“The government did not act expeditiously to afford Ahmed Ghailani a trial after subjecting him to enhanced interrogation techniques and then forcing him to languish for years at Guantanamo Bay,” Quijano said in an email statement. “A claim of national security does not and cannot suspend and vitiate one’s fundamental right to a speedy trial. Here, a delay of more than five years — during which the defendant was tortured to extract information — was constitutionally excessive.”

The three-judge panel concluded Ghailani’s right to a speedy trial was not violated.

The court seemed to embrace an opportunity to say that evidence necessary to prosecute in U.S. civilian courts and the legal rights of a defendant are not necessarily spoiled by efforts to obtain intelligence from terrorism suspects.

“This appeal presents a question bound to arise from the government’s efforts to obtain actionable and time-sensitive intelligence necessary to thwart acts of terror, while still bringing those charged with committing crimes of terrorism against Americans to justice in an orderly fashion under the laws of our country,” Circuit Judge Jose A. Cabranes wrote.

The 2nd Circuit noted that the Supreme Court “has repeatedly held that the government may purposely delay trials for significant periods of time, so long as, on balance, the public and private interests render the delay reasonable.”

Ghailani, 39, had been transferred to Guantanamo Bay in 2006 and moved to New York City for trial in 2009.

He was convicted in 2010 of a single count of conspiring to destroy government buildings and was acquitted of 280 charges that he took part in the bombings. Prosecutors said he helped an al-Qaida cell buy a truck and components for explosives for one of the bombings. He is serving a life sentence.

U.S. District Judge Lewis A. Kaplan had imposed the maximum sentence, saying that whatever Ghailani suffered “pales in comparison to the suffering and the horror” caused by the nearly simultaneous attacks.