WASHINGTON (Reuters) - President Donald Trump’s pick to head the FBI, Christopher Wray, on Wednesday said he would refuse to pledge loyalty to Trump, rejected his description of the probe into Russian election meddling as a “witch hunt,” and vowed to quit if asked by the president to do something unlawful.

Wray, nominated by Trump on June 7 to replace the fired James Comey as Federal Bureau of Investigation director, sought to stake out independence from the president and protect the agency from partisan political influence. Wray even said it would be “highly unlikely” he would agree to meet Trump in a one-on-one situation, as Comey reluctantly did.

Wray, who seemed headed for U.S. Senate approval to fill the 10-year post, testified during a 4 1/2-hour hour Judiciary Committee confirmation hearing amid an uproar in Washington over 2016 emails released on Tuesday involving the president’s son, Donald Trump Jr.

The emails showed the Republican president’s son agreeing last year to meet a woman he was told was a Russian government lawyer who might have damaging information about Democratic White House rival Hillary Clinton as part of Moscow’s official support for his father.

Wray deflected specific questions from Republican Senator Lindsey Graham about the president’s son’s emails, saying he had not read them. But Wray said, “Any threats or effort to interfere with our election from any nation-state or any non-state actor is the kind of thing the FBI would want to know.”

Trump’s son did not notify the FBI and wrote “I love it” about the Russian’s offer of information on Clinton.

Trump fired Comey on May 9, igniting a political firestorm, and later cited the “Russia thing” as his reason. The Justice Department eight days later named Robert Mueller to serve as special counsel to investigate alleged Russian interference in the 2016 presidential race to help Trump win and potential collusion between Moscow and Trump associates.

Slideshow ( 8 images )

The Russia matter has dogged Trump’s first six months in office. Wray said he had no reason to doubt the U.S. intelligence community’s conclusion that Russia interfered in part by hacking and releasing emails damaging to Clinton, a claim Moscow denies.

Wray worked at the Justice Department under Republican former President George W. Bush when Comey was deputy attorney general and Mueller was FBI director. Wray also represented New Jersey Governor Chris Christie in a political scandal.

Trump has called the Russia probe a “witch hunt.”

“I do not consider Director Mueller to be on a witch hunt,” Wray told Graham.

Wray said he was “very committed” to supporting Mueller’s investigation, calling him a “consummate straight shooter and somebody I have enormous respect for.”

Democratic Senator Dianne Feinstein asked Wray to inform the committee “if you learn about any machinations to tamper with” Mueller’s probe.

Slideshow ( 8 images )

“Understood,” Wray responded.

NO LOYALTY OATH

Wray said no one at the White House had asked that he pledge loyalty to Trump, as Comey said the president demanded of him on Jan. 26. Wray said he would not give such an assurance if asked.

“My loyalty is to the Constitution, to the rule of law and to the mission of the FBI. And no one asked me for any kind of loyalty oath at any point during this process, and I sure as heck didn’t offer one,” Wray said.

Comey previously told the same committee Trump pressed him in a one-on-one session to drop the FBI investigation into former national security advisor Michael Flynn’s ties to Russia. Comey said he felt he was fired in a bid by Trump to undercut the Russia probe.

Democratic Senator Patrick Leahy asked Wray, “If the president asks you to do something unlawful or unethical, what do you say?”

“First, I would try to talk him out of it. And if that failed, I would resign,” Wray replied.

The allegation involving Trump pressing Comey on Feb. 14 over the Flynn probe raised questions about whether Trump’s behavior amounted to obstruction of justice, a potential issue in any potential future effort in Congress to impeach the president and remove him from office.

Wray sought to differentiate himself from Comey. Wray was asked about Comey’s July 2016 news conference announcing that no criminal charges were planned against Clinton over her use of a private email server to handle classified information but faulting her conduct.

“I can’t imagine a situation where as FBI director I would be giving a press conference on an uncharged individual, much less talk in detail about it,” Wray testified.

Graham questioned Wray about a January report by the U.S. news organization Politico that a Ukrainian-American operative who was consulting for the Democratic National Committee had met with Ukrainian embassy officials in Washington in a bid to help Clinton and expose links between Trump, top campaign aide Paul Manafort and Russia.

Wray said it would be wrong for Ukraine to meddle in the election and “I’d be happy to dig into it.”