Mr. Martinez’s success at building a rapport with the most ruthless of terrorists goes to the heart of the interrogation debate. Did it suggest that traditional methods alone might have obtained the same information or more? Or did Mr. Mohammed talk so expansively because he feared more of the brutal treatment he had already endured?

Image A courtroom artists sketch of Khalid Shaikh Mohammed, the primary suspect in the 9/11 attacks. Credit... Janet Hamlin/Associated Press, Pool

A definitive answer is unlikely under the Bush administration, which has insisted in court that not a single page of 7,000 documents on the program can be made public. The C.I.A. declined to provide information for this article, in part, a spokesman said, because the agency did not want to interfere with the military trials planned for Mr. Mohammed and four other Qaeda suspects at Guantánamo Bay, Cuba.

The two dozen current and former American and foreign intelligence officials interviewed for this article offered a tantalizing but incomplete description of the C.I.A. detention program. Most would speak of the highly classified program only on the condition of anonymity.

Mr. Martinez declined to be interviewed; his role was described by colleagues. Gen. Michael V. Hayden, director of the C.I.A., and a lawyer representing Mr. Martinez asked that he not be named in this article, saying that the former interrogator believed that the use of his name would invade his privacy and might jeopardize his safety. The New York Times, noting that Mr. Martinez had never worked undercover and that others involved in the campaign against Al Qaeda have been named in news articles and books, declined the request. (An editors’ note on this issue has been posted on The Times’s Web site.)

The very fact that Mr. Martinez, a career narcotics analyst who did not speak the terrorists’ native languages and had no interrogation experience, would end up as a crucial player captures the ad-hoc nature of the program. Officials acknowledge that it was cobbled together under enormous pressure in 2002 by an agency nearly devoid of expertise in detention and interrogation.

“I asked, ‘What are we going to do with these guys when we get them?’ ” recalled A. B. Krongard, the No. 3 official at the C.I.A. from March 2001 until 2004. “I said, ‘We’ve never run a prison. We don’t have the languages. We don’t have the interrogators.’ ”

In its scramble, the agency made the momentous decision to use harsh methods the United States had long condemned. With little research or reflection, it borrowed its techniques from an American military training program modeled on the torture repertories of the Soviet Union and other cold-war adversaries, a lineage that would come to haunt the agency.