The Senate confirmed Todd Blanche as attorney general in an early morning vote Saturday, installing President Donald Trump's former personal lawyer as the permanent head of the Justice Department after a confirmation fight that came close to failing.

Senators voted 50-49 at 4:31 a.m., just before the chamber began a five-week recess, according to Yahoo News. Republican Senators Susan Collins of Maine and Lisa Murkowski of Alaska joined every Democrat in opposition, CBS News reported. Senator Mitch McConnell of Kentucky was absent.

Blanche's path cleared Friday when Senator Bill Cassidy of Louisiana announced his support. With two Republican defections and McConnell away, Cassidy's vote was decisive. Senator John Curtis of Utah also backed the nomination.

Blanche, 52, left a Wall Street law firm in 2023 to join Trump's legal team. He helped lead the defense in the New York hush money case that ended in a conviction on 34 felony counts, and in the dismissed federal case over classified documents. He was later confirmed as deputy attorney general and took over as acting attorney general in April after Trump fired Pam Bondi.

Collins said she opposed the nomination because of what she described as actions that had eroded the department's independence. Senator Dick Durbin of Illinois, the ranking Democrat on the Judiciary Committee, called the confirmation a serious mistake, according to the Associated Press.

Cassidy argued that Blanche's history as Trump's defense lawyer could make him more effective at resisting improper demands, and said the vote was not a referendum on the president, the AP reported. Cassidy lost his primary this year to a Trump-backed challenger.

A group of 1,200 former Justice Department employees signed a letter earlier this month urging the Senate to reject the nomination.

Blanche said on social media that he was honored by the president's confidence and grateful to senators for working late.