President Trump’s sudden ouster of FBI Director James Comey in May set off a legal and political conflagration that eventually led to the appointment of a special counsel. The confirmation process for Christopher Wray, Trump’s chosen replacement for Comey, could not have been less controversial by comparison.

The Senate voted to confirm Wray, a former federal prosecutor, in a 92-5 vote on Tuesday. Though he ultimately will answer to Special Counsel Robert Mueller, a former FBI director himself, on the investigation into Russian interference in the 2016 election, Wray will oversee the bureau’s role in the sprawling federal probe.

His leadership will inevitably come under close scrutiny, given the tempestuous moment in American politics and the fate of his predecessor. During his confirmation hearing, Wray strongly distanced himself from the president and said he would uphold the bureau’s independence. Lawmakers emphasized the latter point during their questioning. “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,” he told members of the Judiciary Committee. “My loyalty is to the Constitution and the rule of law.”

He also publicly defended Mueller’s integrity, even as some pro-Trump surrogates and media outlets had begun challenging the special counsel’s impartiality. “I view him as the consummate straight shooter and somebody I have enormous respect for, and I would be pleased to do what I can to support him in his mission,” he told the committee.

This new gig is not the first time Wray will work alongside the special counsel. Wray led the Justice Department’s Criminal Division during the George W. Bush administration when Mueller was FBI director. He was also among the top Justice Department officials who planned to resign in protest alongside then-Deputy Attorney General Comey and then-FBI Director Mueller during a showdown with the White House over the Stellar Wind warrantless-surveillance program.

As his confirmation hearing wound down, Wray had apparently soothed the fears of Democrats and some Republicans on the committee over his commitment to keeping the bureau impartial. Multiple top Democratic senators, including California’s Dianne Feinstein and Connecticut’s Richard Blumenthal, publicly declared they would support his confirmation—a rare vote of confidence from Democrats in a Trump nominee.

On Tuesday, the only senators to vote against his confirmation were New York’s Kirsten Gillibrand, Massachusetts’ Ed Markey and Elizabeth Warren, and Oregon’s Jeff Merkley and Ron Wyden. North Carolina’s Richard Burr and Minnesota’s Al Franken did not vote; Arizona’s John McCain was also absent as he recovers from brain-cancer treatment.

A criminal and counterintelligence probe of the Russia investigation’s magnitude would be challenging under any circumstances. But Wray’s work will be complicated by the man who appointed him to the position. In both public declarations and private conversations, Trump has made clear his feelings about the inquiry. He routinely describes it as a “witch hunt” hyped up by Democrats who are still smarting over his upset victory last November.

But the FBI has greater constraints on it today than it has in the past. Under J. Edgar Hoover, the bureau collected secret files on thousands of Americans and violated civil liberties with relative impunity. Congress and the FBI’s leadership reined in the organization after Watergate, imposing 10-year terms on directors—Hoover held the post for decades—and reshaping its professional culture toward strict political neutrality. During his tenure, Comey reportedly kept a copy of the request to wiretap Martin Luther King Jr.’s phones in his desk as a reminder of the bureau’s dark history.

Trump, for his part, has expressed disdain for the traditional firewall between the White House’s political interests and the investigative powers of the Justice Department and the FBI. Comey told Congress in June that Trump pressured him to close down an investigation into Michael Flynn, Trump’s former national-security adviser, and asked the FBI director for his personal loyalty. One day after ousting Comey, Trump told top Russian officials that removing the director would help relieve pressure on him over the Russia investigation. (It did not.)

That disdain has apparently not waned since the Comey firestorm. In recent weeks, Trump openly pressured Attorney General Jeff Sessions to investigate Hillary Clinton, his former political opponent, as well as those leaking classified information from within the federal government. He also disputed the idea that the FBI director answers to the Justice Department. “The FBI person really reports directly to the president of the United States, which is interesting,” he told New York Times reporters in a July interview. “And I think we’re going to have a great new FBI director.”