President Donald Trump‘s pick to lead the FBI pledged independence during a high-stakes Senate hearing Wednesday that follows former FBI Director James Comey‘s accusation that Trump asked him for loyalty.

“If I am given the honor of leading this agency, I will never allow the FBI’s work to be driven by anything other than the facts, the law and the impartial pursuit of justice. Period. Full stop.” FBI Director nominee Christopher Wray told the Senate Judiciary Committee.

Wray is a 50-year-old white-collar lawyer who served as assistant attorney general during the George W. Bush administration. If confirmed, he would take over the bureau at a politically charged time, following the White House’s portrayals of the FBI as in disarray and Comey’s assertion that the Trump administration lied about the bureau and its agents. Throughout the hearing, several senators stressed the importance of restoring public trust in the FBI.

Wray was an assistant attorney general in charge of the criminal division from 2003 to 2005. He is currently a litigation partner at King & Spaulding and represented New Jersey Gov. Chris Christie in the Bridgegate scandal.

Trump terminated Comey in May amid a federal probe into Russian attempts to influence the 2016 election and whether the Trump campaign coordinated with Moscow. Trump later said he ousted Comey while thinking about the “Russia thing.”

Comey testified in June that Trump asked him for loyalty shortly after taking office and later made a statement that Comey interpreted as a request to “drop” an investigation into former national security advisor Michael Flynn. Trump has denied making those statements.

After Comey’s ouster, concerns were raised about Trump’s potential efforts to interfere with the FBI’s independence. An FBI director does not owe a president loyalty.

“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 in response to a question from Sen. Patrick Leahy, D-Vermont.

Wray added that he would not give a loyalty oath if asked. Leahy asked what Wray would do if Trump asked him to do anything illegal or unethical.

“First, I would try to talk him out of it, and if it failed, I…