The Senate voted Thursday to confirm William Barr, President Trump’s pick to serve as his next attorney general.

Barr’s confirmation passed a 54-45 mostly party line vote in the GOP-led Senate. The vote came more than three months after Jeff Sessions, Trump's first attorney general, was fired.

Democrats who oppose Barr’s confirmation have criticized his ability to fairly oversee special counsel Robert Mueller’s probe into the Trump campaign’s alleged collusion with Russians. Many said they were alarmed by a 20-page memo Barr authored in June questioning the legitimacy of the Mueller probe and making the case that Mueller should not demand Trump “submit to interrogation about alleged obstruction.”

Barr told Judiciary Committee lawmakers during his confirmation hearing his memo aimed to narrowly address the obstruction question and that he believes Mueller should be able to complete his investigation into alleged collusion.

“The Justice Department needs a leader who will be independent of the White House and who is able to stand up to President Trump, Sen. Dianne Feinstein, of California., who is the top Democrat on the Judiciary Committee, said. "Bill Barr hasn’t demonstrated that he would be that independent leader."

Despite complaints from most Democrats, three of them voted to confirm Barr: Doug Jones of Alabama, Joe Manchin of West Virginia and Kyrsten Sinema of Arizona. Republican Rand Paul, R-Ky., who questioned Barr’s support of federal surveillance tactics, voted against him.

Barr won the overwhelming support of Republican senators, who praised his long career as a lawyer and former attorney general for President George H.W. Bush.

The position has been filled temporarily by Sessions’ chief of staff, Matthew Whitaker, since Sessions was fired.