Updated

President Trump is getting a new director of the FBI after the Senate confirmed his choice of Christopher Wray to take over the bureau on Tuesday.

The Senate voted 92 to 5 to approve Wray’s nomination.

“The good work of the FBI has been overshadowed recently by controversies, but I hope this confirmation turns the page and begins a new, shining chapter for our nation’s leading law enforcement agency,” Senate Judiciary Committee Chairman Chuck Grassley said after the vote.

Trump announced his selection of Wray to lead the FBI in early July after abruptly firing FBI Director James Comey in May.

Comey was fired by the president amid tensions over the Russia investigation. During his confirmation hearing, Wray testified that he'd conduct his job "without regard to any partisan political influence."

“I believe to my core that there’s only one right way to do this job,” Wray told the Senate Judiciary Committee. “And that is with strict independence. By the book. Playing it straight. Faithful to the Constitution."

WRAY VOWS 'STRICT INDEPENDENCE' IN CONFIRMATION HEARING

During Tuesday's vote before the full Senate, all five nay votes came from liberal Democrats: Sens. Kirsten Gillibrand of New York, Elizabeth Warren of Massachusetts, Ed Markey of Massachusetts, Ron Wyden of Oregon and Jeff Merkley of Oregon.

“In his public and private statements, Chris Wray failed to oppose government backdoors into Americans’ personal devices, or to acknowledge the facts about encryption,” Wyden said in a statement explaining his opposition.

Last month, the Senate Judiciary Committee unanimously approved Wray’s nomination and was praised by Republicans and Democrats alike.

Wray has worked on white-collar crime and regulatory cases as a partner at the King & Spalding law firm. From May 2001 to May 2005, he held various high-ranking positions in the Justice Department, rising to the head of the criminal division in September 2003. He also served as principal associate deputy attorney general.

He was a federal prosecutor in the U.S. attorney's office for the Northern District of Georgia from May 1997 to May 2001.

Wray had represented New Jersey Gov. Chris Christie in the so-called Bridgegate scandal.

Fox News' Chad Pergram and The Associated Press contributed to this report.