It hardly occurred to the lawyers that someone inside the detention-camp headquarters might be trying to help them, Olshansky told me not long ago. For all the public debate about Guantánamo, there was little sign that members of the military were defying their superiors. Uniformed lawyers who had been assigned to defend some of the prisoners before military commissions had begun criticizing the rules for those tribunals, but that dissent was explicitly tolerated by the Pentagon. Some Muslim servicemen at Guantanamo, including an Army chaplain, Capt. James Yee, had been investigated on suspicion of disloyal conduct. But that episode and the others seemed to suggest more about the high-security atmosphere of the camp than it did about any internal opposition to how the prisoners were treated. The valentine was different: no one had taken the law into his own hands quite like this.

Olshansky agonized for weeks over what to do. The center’s president, Michael Ratner, initially suggested giving the papers to the press. But after some consultation with other lawyers, Olshansky called the chambers of the federal district judge who was hearing her Guantanamo suit. Olshansky told the judge’s clerk she had received some information that might be relevant to the case. Could she send it over for safekeeping? She said she never expected the court’s response: Olshansky was instructed to turn the material over to the Justice Department instead.

On March 15, 2005, a federal agent in a black overcoat flew to New York from Washington. He took a cab to the center’s offices in downtown Manhattan and kept it waiting while he went to retrieve the card and its contents. Once the F.B.I. began to investigate, it had little difficulty narrowing the list of possible suspects. Diaz had printed the document from his own computer, bought the valentine at the base exchange and left his fingerprints on the list. This past May, Matthew Diaz became the only United States serviceman to be convicted and imprisoned for an act of insubordination directed at the Bush administration’s detention policies.

Diaz volunteered to go to Guantánamo in early 2004, after a year and a half as the deputy legal officer at Naval Station Great Lakes, a training base north of Chicago. He hadn’t been enthusiastic about the Great Lakes assignment, but in his steady, low-key way he did very well there. His superior, Cmdr. Peter J. Straub, recommended Diaz for early promotion, describing him as “the consummate naval officer” and “a stellar leader of unquestionable integrity.” Six good months at Guantánamo would certainly help his chances of making commander, Straub told him.

With other legal officers being shipped off to Afghanistan and Iraq, Cuba sounded pretty good to Diaz: challenging, not dangerous and reasonably close to Jacksonville, Fla., where his 12-year-old daughter lived with his ex-wife. He did not question the military’s need to detain some suspected terrorists, he told me later. At the Army’s legal academy in Charlottesville, Va., where he earned a master’s degree in 2002, he had not been among those outraged by the Bush administration’s decision to set aside the Geneva Conventions in the fight against terrorism. “My takeaway from all of that,” he told me in one of a number of conversations I had with him before and during his confinement at the Navy brig in Charleston, S.C., “was that there was still an order from the Defense Department that they be treated humanely.”

But as Diaz prepared to deploy in the spring of 2004, questions about how the law applied at Guantánamo were coming to the fore. Diaz had known a couple of the military defense lawyers who were criticizing the rules for the tribunals there; he admired their audacity in speaking out. He was also struck by one of the briefs filed in Rasul v. Bush, the federal lawsuit that asserted the right of the Guantánamo prisoners to contest their detention in the court. Two authors of the brief were retired leaders of the Navy legal corps in which Diaz served. “To be sure,” they wrote, “this is a perilous time, as the president has stated. But that does not justify indefinite confinement without any type of hearing or judicial review.”

The Supreme Court decided the Rasul case on June 28, 2004, a week before Diaz arrived on Guantánamo. On his first full day on the base, he went along to watch guards notify the detainees about the new system of parole-type review boards that the military was hurriedly setting up in response to the ruling. Diaz was skeptical of the plan. “It just didn’t seem right that we were creating this new process that no one really ever heard of instead of finding a way to let them get into district court,” he said later.