With his administration reeling from revelations that U.S. intelligence agencies are snooping on Americans and foreigners in unprecedented ways, President Obama knew his nominee to succeed 12-year veteran FBI Director Robert Mueller had to strike just the right note.

In turning to James Comey, a Republican who served as deputy attorney general in the George W. Bush administration, Obama pulled off quite a feat in hyper partisan Washington: putting forward someone who won praise from both parties and appears headed for easy confirmation. Along with his GOP credentials, Comey is known for bucking the top brass at the Justice Department over waterboarding and the Bush administration's warrantless surveillance program, so he has friends and admirers on both sides of the aisle.

And, unlike ex-Sen. Chuck Hagel, Obama's GOP choice for defense secretary who appeared ill-prepared to answer tough questions when he faced former Senate peers, Comey sailed through his confirmation hearing.

It was clear from the start that Comey was in friendly territory. Sen. Patrick Leahy, D-Vt., chairman of the Senate Judiciary Committee and a longtime critic of waterboarding, started off with a question that displayed their like-minded views on the topic.

"Is waterboarding torture?" Leahy asked.

"Yes," Comey said.

"Would you agree to answer this question the same way no matter who was president?" Leahy pressed.

"Oh, certainly," Comey replied.

A graduate of the University of Chicago Law School, Comey, 52, was a federal prosecutor for 15 years before becoming deputy attorney general and going on to serve as general counsel for defense contractor Lockheed Martin, so he knows how to maneuver around tough questions. While he agreed in principle with many senators on particular questions, he avoided committing himself to policy details.

Sen. Ted Cruz, R-Texas, asked whether he was concerned that the FBI had failed to connect the dots beforehand to prevent the Benghazi, Libya, consulate attack and the Boston Marathon bombing.

"I don't know enough from this vantage point, senator, to comment on the particular cases," he said. "Obviously, I think it's always important to connect the dots as best you can."

Comey also sprinkled his responses with the word "transparency," saying he viewed government openness and accountability as critical. But he also defended the National Security Agency's collection of citizens' telephone and Internet data. "As a general matter ... the collection of metadata and analysis of metadata is a valuable tool in counterterrorism," he said.

He even defended the secret court that authorizes government surveillance activities, arguing that it is not a "rubber stamp."

There was so little friction that by the hearing's end even the top Republican told Comey his confirmation was all but assured.

"I'd be surprised if [your] confirmation is not unanimous," Sen. Orrin Hatch, R-Utah, told him.