GUANTÁNAMO BAY, Cuba — In the torturous history of the U.S. government’s black sites, the F.B.I. has long been portrayed as acting with a strong moral compass. Its agents, disgusted with the violence they saw at a secret C.I.A. prison in Thailand, walked out, enabling the bureau to later deploy “clean teams” untainted by torture to interrogate the five men accused of conspiring in the attacks of Sept. 11, 2001.
But new information that emerged this week in the Sept. 11 case undermines that F.B.I. narrative. The two intelligence agencies secretly arranged for nine F.B.I. agents to temporarily become C.I.A. operatives in the overseas prison network where the spy agency used torture to interrogate its prisoners.
The once-secret program came to light in pretrial proceedings in the death penalty case. The proceedings are currently examining whether the accused mastermind of the Sept. 11 plot, Khalid Shaikh Mohammed, and his four co-defendants voluntarily confessed after years in the black site network, where detainees were waterboarded, beaten, deprived of sleep and isolated to train them to comply with their captors’ wishes.
At issue is whether the military judge will exclude from the eventual trial the testimony of F.B.I. agents who questioned the defendants in 2007 at Guantánamo and also forbid the use of reports that the agents wrote about each man’s account of his role in the hijacking conspiracy.
A veteran Guantánamo prosecutor, Jeffrey D. Groharing, has called the F.B.I. interrogations “the most critical evidence in this case.” Defense lawyers argue that the interrogations were tainted by the years of torture by U.S. government agents.
In open court on Thursday, another prosecutor, Clayton G. Trivett Jr., confirmed the unusual arrangement, in which nine F.B.I. agents were “formally detailed” to the agency “and thus became a member of the C.I.A. and worked within C.I.A. channels.”
He said that the agents served as “debriefers,” a C.I.A. term for interrogators, and questioned black site prisoners “out of the coercive environment” and after the use of “E.I.T.s.”
E.I.T.s, or enhanced interrogation techniques, is a C.I.A. euphemism for a series of abusive tactics that the agency used against Mr. Mohammed and other prisoners in 2002 and 2003 — tactics that were then approved but are now illegal. They include waterboarding, painful shackling and isolating a prisoner nude, shivering and in the dark to break his will to resist interrogation.
Mr. Trivett offered no precise time period but made clear that the F.B.I. agents were absorbed by the C.I.A. sometime between 2002, when the black sites were established, and September 2006. On their return to the F.B.I., they took on the status of C.I.A. assets, he said, and so their identities are classified.
Five of the nine agents had roles in the interrogations of some of the defendants in the case, Mr. Trivett said, and their names have been provided to defense lawyers on the basis that they not be disclosed.
The F.B.I. declined to comment on the arrangement, as did the C.I.A.
A defense lawyer, James G. Connell III, added more details in the same court hearing.
He said that the nine agents “stopped being F.B.I. agents and became C.I.A. agents temporarily” under a memorandum of understanding that established a different arrangement than the more typical assignment of a representative of one law enforcement agency to work out of the organization of another.
A former C.I.A. historian, Nicholas Dujmovic, said there was a precedent for “taking employees from another government agency and quickly making them C.I.A. employees for specific functions.”
In the 1950s, the C.I.A. transformed U.S. Air Force pilots into C.I.A. employees during their stints flying U-2 spy planes and then returned them to the Air Force without the loss of seniority or benefits. “President Eisenhower thought it was important that U-2s not be piloted by U.S. military pilots,” Dr. Dujmovic said. The process was called “sheep dipping,” he said.
Earlier testimony showed the F.B.I. participating remotely in the C.I.A. interrogations through requests sent by cables to the black sites seeking certain information from specific detainees, including Mr. Mohammed after he was waterboarded 183 times to force him to talk.
The pretrial hearings are in their ninth year and the military judge, Col. Matthew N. McCall of the Air Force, is the fourth judge to hear testimony at Guantánamo. In arguing over potential trial evidence, the prisoners’ lawyers have repeatedly accused prosecutors of redacting information that the defense needs to prepare for the capital trial. In the military commissions, prosecutors are the gatekeepers of potential trial evidence and can withhold information they deem not relevant to the defense’s needs.
In one example, Mr. Connell showed the judge a November 2005 cable the F.B.I. sent to the C.I.A. that contained questions for three of the defendants while they were in a black site — out of reach of the courts, lawyers and the International Red Cross.
The F.B.I. released the cable to the public this month under an executive order by President Biden to declassify information about the F.B.I. investigation of the Sept. 11 attacks.
Mr. Connell had earlier received a version of the same cable from prosecutors. But it was so redacted that it obscured the fact that the F.B.I. wanted Mr. Mohammed and the other defendants questioned in the black sites.
Mr. Trivett sought to play down the disclosure of the F.B.I.-C.I.A. collaboration as routine business at a time when the U.S. government was devoting tremendous resources to investigating the Sept. 11 attacks. “This is not some big bombshell,” he told the judge.
A lawyer for Mr. Mohammed, Denny LeBoeuf, cast the collaboration as part of a conspiracy to portray F.B.I. accounts of interrogations of the defendants at Guantánamo in 2007 as “clean team statements,” a law enforcement expression.
“They were never clean,” Ms. LeBoeuf said. “Torture isn’t clean. It is filthy. It has sights and sounds and consequences.”