James Comey is the grandson of an Irish cop. But it’s not the policeman in his DNA that makes him the right choice to run the Federal Bureau of Investigation. It’s his deep understanding of the power of secret intelligence.

Comey arrived as the No. 2 man at the Justice Department in December 2003, a time of political and constitutional crisis. President George W. Bush had ordered the FBI “to adopt a wartime mentality” after the Sept. 11 attacks, as Bush described it in his memoir. FBI Director Robert Mueller, who had taken office a week before the attacks, had done his best. Now the bureau was going beyond the law in the name of national security.

FBI agents were tracking thousands of telephones, e-mails and Internet addresses in the U.S. under the eavesdropping aegis of the National Security Agency. The highly secret programs were conducted under the code name Stellar Wind; Bush and Attorney General John Ashcroft had to reauthorize them every 45 days.

The number of people who knew the facts was exceedingly small. But Comey was among them.

Comey thought Stellar Wind violated the Constitution’s protections against warrantless searches and seizures. He convinced Mueller, who saw no evidence that the surveillances had saved a life, stopped an imminent attack or discovered an al-Qaeda member in the U.S.

Secrecy Showdown

Now the two men had to confront the president in a showdown over secrecy and democracy.

On March 4, 2004, Comey told Ashcroft, his boss, that he couldn’t reauthorize Stellar Wind as it stood. Ashcroft agreed. That night, the attorney general was struck with a potentially fatal case of gallstone pancreatitis, sedated and set for surgery. Comey became the acting attorney general.

On March 10, Bush ordered White House chief of staff Andrew Card and White House counsel Alberto Gonzales to get Ashcroft’s signature for the reauthorization of Stellar Wind. Ashcroft was in intensive care after surgery, drifting in and out of consciousness. The president called and insisted on talking to Ashcroft on a matter of national security. His wife took the call. She wouldn’t hand over the phone.

Alerted by FBI agents guarding Ashcroft, Comey raced to the hospital. Card and Gonzales entered holding a manila envelope with the presidential authorization inside and demanded a signature. Ashcroft lifted his head off his pillow and denounced the program as illegal.

Then he sank down and said: “I’m not the attorney general. There is the attorney general.” And then he pointed at Comey -- the leader of the rebellion against Stellar Wind and the chief law enforcement officer of the United States.

The president nevertheless signed the reauthorization alone on the morning of March 11. It explicitly asserted that his powers as commander in chief overrode all other laws of the land.

Mueller drafted a letter of resignation by hand: “I am forced to withdraw the FBI from participation in the program,” he wrote. “Further, should the President order the continuation of the FBI’s participation in the program, and in the absence of further legal advice from the AG, I would be constrained to resign as Director of the FBI.”

The president and Mueller met the next day in the Oval Office. Mueller told Bush that he would resign if the FBI was ordered to continue warrantless searches on Americans without an order from the Department of Justice. The president pleaded ignorance of the law and the facts. Without doubt, he saw a political disaster at hand -- if Mueller, Ashcroft and Comey resigned over a program both illegal and too secret to describe, Bush conceivably could be impeached.

Presidential Promise

“I had to make a big decision, and fast,” Bush wrote in his memoirs. “I thought about the Saturday Night Massacre in October 1973” -- when President Richard Nixon defied the Justice Department over his secret tapes, forced the attorney general and his deputy to resign, and destroyed his presidential power.

“That was not a historical crisis I was eager to replicate,” Bush wrote. “It wouldn’t give me much satisfaction to know I was right on the legal principles while my administration imploded and our key programs in the war on terror were exposed in the media.”

Bush promised to put the programs on a legal footing. This took years. But based on the president’s promise, Mueller and his allies backed down from their threats to resign. By the time the first facts were revealed in the New York Times, 20 months later, both Ashcroft and Comey had left the Bush administration.

Mueller has never discussed the confrontation in public. Comey has. He told a group at the National Security Agency what Mueller had heard at the White House: “If we don’t do this, people will die.”

“You can all supply your own ‘this,’” Comey said. “‘If we don’t collect this type of information,’ or ‘If we don’t use this technique,’ or ‘If we don’t extend this authority.’ It is extraordinarily difficult to be the attorney standing in front of the freight train that is the need for this.”

“It takes far more than a sharp legal mind to say ‘no’ when it matters most,” he said. “It takes moral character. It takes an ability to see the future. It takes an appreciation of the damage that will flow from an unjustified ‘yes.’ It takes an understanding that, in the long run, intelligence under law is the only sustainable intelligence in this country.”

Comey stood before the train. There will be more coming down the track in years to come.

(Tim Weiner, a former reporter for the New York Times, has won the Pulitzer Prize and the National Book Award for writing on national security. He is the author, most recently, of “Enemies: A History of the FBI,” which recounts James Comey’s comments. The opinions expressed are his own.)

To contact the writer of this article: Tim Weiner at tiwein@hotmail.com.

To contact the editor responsible for this article: Katy Roberts at kroberts29@bloomberg.net.