In terms of hospital bedside dramas, it had all the elements – intrigue, confrontation and real life consequences.

And FBI Director James Comey was smack dab in the middle of it all.

It was 2004, and Comey, then a deputy attorney general in the Department of Justice, rushed to the bedside of then-Attorney General John Ashcroft to warn him of the White House’s efforts to reauthorize a warrantless eavesdropping program.

Comey arrived in Ashcroft’s room just minutes before two White House aides and told his boss not to sign anything.

“I’ve long been a big fan of the rule of law,” Comey said during a visit to Buffalo on Tuesday. “To me, the intelligence programs that are the most firmly rooted in all three branches of our government are the best.”

Comey, who traveled to Buffalo as part of an ongoing global tour of FBI offices, talked at length about government surveillance and his role in opposing the warrantless eavesdropping that took place 10 years ago.

He would later support a revised version of the surveillance program, but his initial opposition earned him a reputation for independence and integrity.

So what does the FBI’s new director – he’s been on the job only since September – think about the National Security Agency’s bulk collection of domestic phone records?

He thinks it’s a far different animal.

“Folks can disagree with the policy and reasonable people do disagree as to whether the federal government should have such a database,” he told reporters. “What can’t be said is that this is some type of rogue, lawless conduct. This was our government operating as it was designed.”

The biggest difference, Comey says, is that, unlike the eavesdropping program he opposed 10 years ago, all three branches of government have approved the NSA’s collection of phone records.

And what about Edward Snowden, the former NSA employee who leaked classified information revealing the NSA program and a man many Americans consider a whistleblower or even a hero?

Comey, citing his agency’s criminal investigation into Snowden, said he did not want to characterize Snowden’s actions, but he did indicate that he hopes there will be a debate over the pros and cons of the NSA program.

“What I hope we can do, which is difficult given some of the current storm around these revelations, is have a serious adult conversation,” he said. “What is this collection of telephone data? Why does it matter? And if we do away with it, what do we lose and what do we gain?”

Since his confirmation, Comey has made a point of visiting FBI offices across the country and the world. Buffalo is his 26th stop.

He met with local FBI agents and employees in closed, tightly secured meetings inside City Hall’s Common Council Chambers and with state and local law enforcement officials in the agency’s downtown headquarters.

A native of Yonkers, Comey came to the FBI after serving as a federal prosecutor in Manhattan and Virginia and, after 9/11, as U.S. attorney in New York.

He was picked by Ashcroft to serve as deputy attorney general in 2003 but left government two years later and spent the next seven years working in the private sector, first with defense contractor Lockheed Martin and later with a Connecticut-based hedge fund.

Nominated for the FBI job by President Obama, he took over the agency in September, replacing Robert Mueller, who stepped down after 12 years as director. But even before joining the FBI, Comey had gained a reputation as a government lawyer willing to speak his mind.

During his Senate confirmation hearing, he criticized many of the “enhanced” interrogation techniques that were used while George W. Bush was president and he was at the Justice Department.

He said waterboarding should be considered illegal and a form of torture, and he pledged to oppose it as long as he’s at the FBI.

“In 2014, it’s clear that conduct is forbidden and is unlawful and prohibited to all parts of the United States government,” he said Tuesday. And “It’s never something the FBI has been involved in.”

Comey has said in the past that he made his views on waterboarding and other interrogation techniques known during his tenure under Bush, but that his objections were dismissed by the White House.

Despite that, critics such as the American Civil Liberties Union claim it was Comey who in the end signed off on the enhanced interrogation techniques.

Comey touched on a number of topics during his meeting with reporters, including cyber threats, the growing heroin epidemic and his agency’s now “productive” relationship with its Russian counterparts at the Winter Olympics in Sochi.

He was scheduled to return to Washington, D.C. after his visit here.