Mr. Khan, 31, lived in the Baltimore area from 1996 to early 2002 before returning to his native Pakistan, where he is accused of having worked with Khalid Shaikh Mohammed, the self-described mastermind of the terrorist attacks of Sept. 11, 2001. Both were captured in early 2003. Mr. Khan faces an arraignment before a military commission next week. If the deal holds, he will be the first of the “high value” detainees — those who were held for a period in secret prisons run by the Central Intelligence Agency and subjected to harsh interrogation techniques — to receive a plea deal in the tribunals system. Military officials charged Mr. Khan with war crimes this month. While the charges carried a potential life sentence, the filing prompted rumors that his defense team and the Pentagon were in the late stages of negotiations for a plea deal. The Washington Post first reported Wednesday on its Web site that a deal had been reached, saying it involved a commitment that Mr. Khan would stay at Guantánamo in Cuba for at least four years to testify in other detainees’ trials. At some point, he would be eligible for transfer to Pakistan, The Post said. A military spokesman, Lt. Col. Todd Breasseale, said that Mr. Khan would have an arraignment next week but would not discuss any deal. According to military and intelligence officials, Mr. Mohammed selected Mr. Khan to carry out follow-up attacks in the United States because of his English language abilities and familiarity with the country. Officials say the two discussed blowing up gas stations and poisoning reservoirs, among other plots. A classified file originally obtained by WikiLeaks also contends that Mr. Mohammed sent Mr. Khan with a suicide vest to assassinate Pervez Musharraf, then the president of Pakistan. The bomb was fake, and the operation was just a test of his mettle.