GUANTÁNAMO BAY, Cuba — During the more than three years he spent in C.I.A. prisons before being sent to Guantánamo Bay, Majid Khan says he was hung from his wrists, naked and hooded, for two straight days, causing wild hallucinations.
Mr. Khan, a confessed Qaeda courier, was held in almost total darkness for a year, fearing he would be drowned in an icy tub and isolated in a cell with bugs that bit him until he bled. In 2004, his second year of C.I.A. detention, the agency "infused" a purée of pasta, sauce, nuts, raisins and hummus up Mr. Khan's rectum when he went on a hunger strike, according to a Senate Intelligence Committee report.
Now Mr. Khan and his legal team are pursuing a strategy in an effort to force the United States government to acknowledge what was done to him in a way it never has for any of the detainees who were subjected to torture — and to give him a measure of compensation for it.
Mr. Khan pleaded guilty at his military tribunal in 2012 to delivering $50,000 of Qaeda money that helped finance the 2003 bombing of a Marriott Hotel in Jakarta, Indonesia, which killed 11 people, and plotting other, unrealized terrorist attacks. He remains in the military prison at Guantánamo Bay, but he has yet to be sentenced because he agreed to become a government witness in return for a chance at leniency.
As part of the sentencing process, his lawyers are arguing that the treatment Mr. Khan endured in C.I.A. custody also needs to be taken into account and are asking the military judge in the case to grant Mr. Khan time off his prison term as a form of credit for what the C.I.A. did to him.
The Army judge in the case has agreed to hear arguments from prosecution and defense lawyers at Guantánamo starting July 9 about his authority to provide reparation for the torture the United States government carried out after the Sept. 11, 2001, attacks.
Scott Roehm, the Washington policy director for the Center for Victims of Torture, an advocacy group, said the decision facing Mr. Khan's judge would be "a watershed moment" because of the opportunity to hold the United States legally responsible for the interrogation program after Sept. 11.
Mr. Khan's case tests "whether the military commissions will grapple seriously and fairly with the United States' legacy of torture," he said.
The government has signaled that it will fight the request. In a filing last month, prosecutors urged the judge to not call witnesses or hear evidence on what happened to Mr. Khan. They argued that there was no provision for a military commission judge to adopt the practice — used in military court-martials — of granting credit for pretrial punishment, and said Mr. Khan could ask the jury of military officers who would one day sentence him to consider the question.
Then after sentencing, prosecutors say, Mr. Khan's lawyers can file a clemency petition with the Pentagon official who oversees the Guantánamo court, called the convening authority.
Although Guantánamo defense lawyers in the capital cases have long sought to, in effect, put the C.I.A. on trial for the years in which it carried out a program of secret detention, 2002 to 2006, the request for credit for pretrial punishment in the Khan case is the first overt effort.
Now the trial lawyers in the case of the five people charged with plotting the Sept. 11 attacks are watching how Mr. Khan's sentencing judge, Col. Douglas K. Watkins, handles the question of pretrial punishment with an eye to whether it could influence how much time the accused masterminds of terrorism serve, or whether they are put to death.
Two lawyers for Ammar al-Baluchi, one of the men accused of conspiring in the 2001 attacks, have submitted a friend-of-the-court brief in the Khan case that argues a military judge can do more than give time-served credit for pretrial punishment.
The lawyers, Maj. Anne Marie Bush of the Air Force and James G. Connell III, wrote "the only appropriate remedy" in Mr. Khan's case "may be dismissal" because of "the incredibly harsh conditions he was held under, the government's intent to cause him suffering and the great length of time under which Mr. Khan was forced to stay in these conditions."
The death penalty cases being tried at Guantánamo have been in pretrial proceedings for years as the military judges have tried to balance basic due process rights with the insistence of the C.I.A. that aspects of the now-defunct black site program are national security secrets. Chief among them are the identities of the C.I.A. agents and others, such as medical officers, who saw or took part in what went on at the sites where the United States held more than 100 people around the globe.
In 2003, at one secret overseas site, a C.I.A. interrogator told an Indonesian prisoner "that he would never go to court, because 'we can never let the world know what I have done to you,'" according to a summary of the comprehensive study of the C.I.A. program that was released by the Senate Select Committee on Intelligence in December 2014.
So far that is true. That prisoner, known as Hambali, a leader of Southeast Asia's Jemaah Islamiyah extremist group, has not been to court since being brought to Guantánamo in September 2006, even though military prosecutors drew up charges against him in 2017.
The question confronting Colonel Watkins, the Army judge in Mr. Khan's case, also illustrates the hybrid nature of the war court, which blends military and civilian court procedures.
When Mr. Khan pleaded guilty to terrorism charges in 2012, government and defense lawyers imported a practice used in federal court gangland cases and agreed to postpone sentencing while he turned informant.
His lawyer said at the time that Mr. Khan was "going to join Team America, do the right thing to make sure that he has a chance for a productive, meaningful life." Mr. Khan's first opportunity to testify as a government witness could come this year at the New York federal retrial of Uzair Paracha, 38, a fellow Pakistani who was caught in the United States and charged with providing material support for terrorism.
Before then, Mr. Khan's lawyers want to apply the military court-martial practice allowing credit for pretrial punishment, which Chelsea Manning received at her court-martial for leaking sensitive military documents. She got 112 days off her sentence for being held in isolating conditions at a brig in Quantico, Va., before her conviction.
Credit for pretrial punishment is not, however, mentioned in the Rules for Military Commissions, the war court handbook. But neither is the idea that a Guantánamo prisoner could plead guilty to war crimes and postpone sentencing for years.
Gary D. Solis, a scholar of military justice, said one section of the Uniform Code of Military Justice "does provide a basis" for providing such credit. But, he said, because the practice is not specifically permitted by the Military Commissions Act, which created the war court, "it's not settled law, and it's a political hazard zone."
He described the military officers serving as war court judges as a "very conservative bunch" and questioned whether one would have "the nerve" to award the credit, knowing a higher court might reverse the move.
"In my view, black site time should be two-for-one," said Mr. Solis, who was a judge during his 18 years as a Marine, and for six years ran West Point's Law of War Program. "A trial court ruling that pretrial confinement credit is due for black site time might be just the excuse the appellate court is looking for to come to a similar legal conclusion."
In the Sept. 11 case, which has no trial date and just obtained its third military judge, defense lawyers are drawing up lists of proposed witnesses to try to disqualify from the trial F.B.I. accounts of confessions at Guantánamo by Khalid Shaikh Mohammed, accused of being the mastermind of the plot, and the four men accused of being his accomplices.
Like Mr. Khan's lawyers, they want to call witnesses from the black sites to argue what Mr. Mohammed and the others told F.B.I. interrogators in their early days at Guantánamo was the product of C.I.A. "enhanced interrogation techniques," a psychologically engineered program of abuse intended to rob them of free will.