Lawyers for a terrorism suspect once held at Guantánamo Bay who is now facing prosecution in Manhattan asked a judge on Tuesday to dismiss his case on the ground that his nearly five years in detention denied him his constitutional right to a speedy trial.

The terrorism suspect, Ahmed Khalfan Ghailani, was captured in Pakistan in 2004, held for two years in secret prisons run by the C.I.A., and then moved in 2006 to the naval base at Guantánamo Bay, Cuba. During his detention, he says, he was subjected to cruel interrogation techniques and denied a lawyer.

Although Mr. Ghailani faces charges stemming from a terrorist act that predated the Sept. 11 attacks, his speedy trial motion could foreshadow issues that could arise in the prosecution of Khalid Shaikh Mohammed, the professed organizer of the 9/11 plot, and four other Guantánamo detainees who were recently ordered sent to New York for trial.

“We respectfully submit that this case presents possibly the most unique and egregious example of a speedy trial violation in American jurisprudence to date,” Mr. Ghailani’s lawyers said in a motion that was heavily censored because of its reliance on classified information.

The motion was originally filed several weeks ago with Judge Lewis A. Kaplan, but it was kept almost entirely under seal pending a review by the government. The new version, with many pages blacked out, was made public on Tuesday.

“This motion asks one primary question,” the lawyers, Peter E. Quijano, Michael K. Bachrach and Gregory Cooper, wrote. “Can national security trump an indicted defendant’s constitutional Right to a Speedy Trial? We respectfully submit that the answer is emphatically and without qualification, ‘No.’ ”

Mr. Ghailani, a Tanzanian who is believed to be in his mid-30s, has pleaded not guilty. He has been charged with conspiring to help carry out Al Qaeda’s 1998 bombings of the American Embassies in Kenya and Tanzania, attacks that killed 224 people. The military has also said that he later served as a cook and a bodyguard for Osama bin Laden.

A spokeswoman for the United States attorney’s office in Manhattan had no comment on the filing.