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

President Donald Trump's pick to head the FBI, Christopher Wray, on Wednesday said he would refuse to pledge loyalty to Mr. 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.

Mr. Wray, nominated by Mr. 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. Mr. Wray even said it would be “highly unlikely” he would agree to meet Mr. Trump in a one-on-one situation, as Mr. Comey reluctantly did.

Mr. 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.

Mr. Wray deflected specific questions from Republican Senator Lindsey Graham about the president's son's emails, saying he had not read them. But Mr. 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.”

Mr. Trump's son did not notify the FBI and wrote “I love it" about the Russian's offer of information on Ms. Clinton.

Mr. Trump fired Mr. 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 Mr. Trump win and potential collusion between Moscow and Trump associates.

The Russia matter has dogged Mr. Trump’s first six months in office. Mr. 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 Ms. Clinton, a claim Moscow denies.

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

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

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

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

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

“Understood,” Mr. Wray responded.

No Loyalty Oath

Mr. Wray said no one at the White House had asked that he pledge loyalty to Mr. Trump, as Mr. Comey said the President demanded of him on Jan. 26. Mr. 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,” Mr. Wray said.

Mr. Comey previously told the same committee Mr. 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. Mr. Comey said he felt he was fired in a bid by Mr. Trump to undercut the Russia probe.

Democratic Senator Patrick Leahy asked Mr. 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,” Mr. Wray replied.

The allegation involving Mr. Trump pressing Mr. Comey on Feb. 14 over the Flynn probe raised questions about whether Mr. 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.

Mr. Wray sought to differentiate himself from Mr. Comey. Mr. Wray was asked about Mr. Comey's July 2016 news conference announcing that no criminal charges were planned against Ms. 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,” Mr. Wray testified.

Mr. Graham questioned Mr. 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 Mr. Trump, top campaign aide Paul Manafort and Russia.

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