Donald Trump’s nominee for CIA director vowed Thursday to defy his boss if asked to commit future acts of torture against suspected terrorists, telling a Senate panel, “I will always comply with the law.”

The promise by Rep. Mike Pompeo (R-Kan.) came during a confirmation hearing that saw the nominee veer sharply from policy positions embraced by the man who chose him for the job. As presidential candidate, Trump endorsed a return to waterboarding, while also repeatedly disparaging the judgment of U.S. intelligence analysts.

A day after Trump appeared to equate the actions of intelligence leaders with Nazi tactics, Pompeo lavished praise on the CIA and its estimated 21,000 employees and said he would not shirk from his duty to present unvarnished facts to the White House and the agency’s congressional overseers.

“I have watched them walk through fire to do their jobs,” Pompeo said of the CIA’s workforce, which he called “the finest intelligence agency the world has ever known.”

Pompeo was pressed by both Republican and Democratic senators about Trump’s campaign promise to reinstate enhanced interrogation methods, which were outlawed by Congress in 2005 following reports that suspected terrorists had been subjected to waterboarding and other coercive tactics in secret detention centers overseas.

(Victoria Walker/The Washington Post)

“Absolutely not,” Pompeo said when asked whether he would obey a presidential order to resume using those methods. Moreover, he added, “I can’t imagine I would be asked” to do so.

He promised the panel that he would “speak truth to power” while ensuring that the CIA’s analysts and officers are unfettered by political considerations.

Pompeo’s chances of confirmation are high: He has strong support in the Republican Party, and Democrats do not have the numbers, either on the Senate Intelligence Committee or in the full Senate, to mount a bid-killing opposition against him by themselves. And Pompeo went through his confirmation hearing Thursday without serious incident, even while distancing himself from some of the president-elect’s more controversial statements.

But his relatively easy grilling in committee belies the political difficulty of the job he could soon inherit: liaison between the country’s intelligence analysts and a president who has repeatedly derided their work.

Pompeo’s confirmation hearing comes on the heels of the president-elect launching the latest broadside at the intelligence community, dismissing as “nonsense” a classified report summarizing allegations that Russia had gathered damaging personal information about him. Trump suggested that intelligence officials might have deliberately leaked the uncorroborated report to smear him, adding: “That’s something Nazi Germany would have done.”

Trump has previously cast doubt on the Intelligence Committee’s findings that Russia was behind a series of hacks and leaks of emails from the Democratic National Committee and Hillary Clinton’s campaign chairman, John Podesta, and that Russian President Vladimir Putin ordered the actions to help Trump’s chances of winning.

What lies ahead for Trump's nominees, and how Democrats helped smooth the way

Since the election, Trump has moderated some of his earlier statements and said he respects the country’s intelligence professionals.

“I think the biggest problem that Mike Pompeo may have is when the president-elect says things that are completely at odds with what he’s briefing the president,” said Rep. Adam B. Schiff (Calif.), ranking Democrat of the House Intelligence Committee in which Pompeo also served.

During Thursday’s hearing, Pompeo told senators that he considered the intelligence community’s report on Russia to be “sound” as an analytical product.

“It’s pretty clear about what took place about Russian involvement in efforts to hack information,” Pompeo continued, saying he was “very clear-eyed” about the intelligence report’s findings and promising to relay his take “not only to the president but to the team around him.”

Yet Pompeo agreed with Republicans that the intelligence community — and government at large — does not have a strategy for counteracting and safeguarding against the type of cyberattacks outlined in the report, from Russia and other countries.

“We have to get better at defending against this,” Pompeo said, calling for an “incredibly robust American response” and pledging to help lawmakers design such a policy.

Pompeo, 53, has served three full terms in the House as a representative from Kansas, including a stint on the House Intelligence Commmittee. In that time, he has won widespread respect for his intellect while also cementing his reputation as a fierce partisan, often leading the attack against the Obama administration on the Benghazi affair and the Iran nuclear deal.

Pompeo sought to stress to lawmakers that he realized his duties would change if confirmed to move from Congress to the CIA.

“My job, if confirmed, will be to change roles,” Pompeo said.

But some on the committee remained concerned that politics would creep into Pompeo’s thinking, even as CIA chief.

Sen. Angus King (I-Maine) questioned Pompeo about a tweet he wrote last year, promoting the WikiLeaks release of the DNC’s hacked emails and asking whether anyone “need[ed] further proof that the fix was in from President Obama on down” about Clinton’s email server.

King asked whether Pompeo considered WikiLeaks to be a “reliable source of information.”

“I have never believed that WikiLeaks was a credible source of information,” Pompeo said.

Democrats also challenged him about his criticism of the administration’s policy and intelligence related to Iran and its compliance with the nuclear pact, which went into effect last year.

Pompeo pledged to lead an agency that makes “objective, sound judgments” about intelligence related to Iran’s compliance — noting that Iran is one of the greatest threats he sees to American security, alongside the Islamic State, Russia and mounting cyberthreats, among others.

Pompeo said his focus as director would be to ensure that the agency “remains the best in the world at its core mission: collecting what our enemies do not want us to know.” He pledged to “lead the agency to aggressively pursue collection operations and ensure analysts have the time, political space and resources to make objective and sound judgments.”

Pompeo faced sharp questions about his public posture on domestic surveillance and his support for reinstating laws allowing the government to collect and store massive amounts of information — called “metadata” — from social media and other private communications. Sen. Ron Wyden (D-Ore.) pressed Pompeo to say whether he thought there were boundaries to the information the intelligence community could collect.

“You have my assurance we will not engage in unlawful activity,” Pompeo said, arguing that if “someone’s out there on their Facebook page talking about an attack,” the intelligence community would be “grossly negligent if they didn’t pursue that information.”

Greg Miller contributed to this report.