NPR reported on Wednesday that former deputy attorney general James B. Comey is President Obama’s top pick for FBI director. The position, filled currently by Robert S. Mueller III, should have a confirmed successor by next week in anticipation of the end of Mueller’s term this September.

Barton Gellman, a senior fellow at the Century Foundation and author of Angler: The Cheney Vice Presidency (Penguin) has covered what is often considered the defining episode in Comey’s time as deputy attorney: his intended resignation, alongside Mueller, in face of the Bush-administration program “Stellar Wind,” which authorized warrantless eavesdropping.

This conflict, with its moral flavor, will likely grant the Republican Comey bipartisan appeal and is worth reviewing. Gellman wrote in the Washington Post of the 2004 confrontations between high-ranking Justice Department and White House officials. When White House counsel Alberto R. Gonzales and Chief of Staff Andrew H. Card attempted to have Attorney General John Ashcroft, then in intensive care, approve the program—which he had already rebuked—Comey and Mueller, alongside Jack L. Goldsmith, chief of the Office of Legal Counsel, intervened. Here’s Gellman:

Comey reached Ashcroft's bedside first. Goldsmith and his colleague Patrick F. Philbin were close behind. Now came Card and Gonzales, holding an envelope. If Comey would not sign the papers, maybe Ashcroft would.

Was Comey going to sit there and watch a barely conscious man make his mark? On an order that he believed, and knew Ashcroft believed, to be unlawful?

Unexpectedly, Ashcroft roused himself. Previous accounts have said he backed his deputy. He did far more than that. Ashcroft told the president's men he never should have certified the program in the first place.

“You drew the circle so tight I couldn't get the advice that I needed,” Ashcroft said, according to Comey. He knew things now, the attorney general said, that he should have been told before. Spent, he sank back in his bed.

President Bush proceeded the next day with the reauthorization of Stellar Wind, despite Justice’s objection. Comey and Mueller prepared their resignation letters. That evening, Card summoned Comey. Here’s Gellman again:

What was all this he heard, Card asked, about quitting?

“I don't think people should try to get their way by threatening resignations,” Comey replied. “If they find themselves in a position where they're not comfortable continuing, then they should resign.”

“He obviously got the gist of what I was saying,” Comey recalled.

Comey’s resignation letter held that the Department of Justice was being cornered into unethical behavior—and that resignation was preferable to the abandonment of principles:

“Over the last two weeks . . . I and the Department of Justice have been asked to be part of something that is fundamentally wrong,” he wrote. “As we have struggled over these last days to do the right thing, I have never been prouder of the Department of Justice or of the Attorney General. Sadly, although I believe this has been one of the institution's finest hours, we have been unable to right that wrong. . . . Therefore, with a heavy heart and undiminished love of my country and my Department, I resign as Deputy Attorney General of the United States, effective immediately.”

The double-resignation of attorney general and deputy attorney—precedented only, as Gellman notes, by Watergate—was avoided when a wary, puzzled Bush pulled Comey aside after their regular briefing on terrorism. When Bush cited his authority to decide law for the executive branch, Comey responded that he, representing the Department of Justice, could not certify to Stellar Wind:

“As Martin Luther said, 'Here I stand; I can do no other,' ” Comey said. “I've got to tell you, Mr. President, that's where I am.”

Now Bush said something that floored Comey.

“I just wish that you weren't raising this at the last minute.”

The last minute! He didn't know.

The president kept talking. Not the way it's supposed to work, popping up with news like this. The day before a deadline?

Wednesday. He didn't know until Wednesday. No wonder he sent Card and Gonzales to the hospital.

“Oh, Mr. President, if you've been told that, you have been very poorly served by your advisers,” Comey said. “We have been telling them for months we have a huge problem here.”

“Give me six weeks,” Bush asked. One more renewal.

“I can't do that,” Comey said. “You do say what the law is in the executive branch, I believe that. And people's job, if they're going to stay in the executive branch, is to follow that. But I can't agree, and I'm just sorry.”

If they're going to stay.

Comey was edging toward a breach of his rule against resignation threats.

This man just needs to know what's about to happen.

“I think you should know that Director Mueller is going to resign today,” Comey said.

Bush raised his eyebrows. He shifted in his chair. He could not hide it, or did not try. He was gobsmacked.

“Thank you very much for telling me that,” he said.

Bush then met with Mueller, who rearticulated Comey’s position. Writes Gellman:

The president stepped back from the precipice. He gave Mueller a message for Comey.

“Tell Jim to do what Justice thinks needs to be done,” he said.

Seven days later, Bush amended his March 11 directive. The legal certification belonged again to the attorney general. The surveillance program stopped doing some things, and it did other things differently. Much of the operation remained in place. Not all of it.

This incident, which at the time passed by the public rather quietly, will receive more significant attention in the press as Comey’s record is explored—especially considering that Mueller has openly supported Comey as his successor.

Read Gellman’s account of Comey and the warrantless domestic surveillance program, “Cheney Shielded Bush from Crisis,” in the Washington Post.

Gellman covers the story in greater detail in chapter 12 of Angler: The Cheney Vice Presidency