The Senate confirmed Alabama Sen. Jeff Sessions to be President Trump's attorney general on Wednesday night, over sustained but ultimately futile Democratic complaints that Sessions worked against minority interests when he was a U.S. attorney for Alabama, and that he's too close to Trump to enforce the law independently from the White House.

Democrats changed the rules in 2013 so that only a simple majority is needed to approve a president's Cabinet nominees. Under those rules, the Senate easily confirmed Sessions in a party-line 52-47 vote, and was helped by Sen. Joe Manchin, D-W.Va., who had said he would support Sessions' nomination.

Sessions himself voted "present," and was met by applause from Republicans after the vote total was read out.

Sessions will participate in a swearing-in ceremony with Trump in the Oval Office at 10:30 a.m. Thursday, according to the White House.

The vote is a vindication for Sessions that was decades in the making, as Democrats constantly sought to remind the public that Sessions was rejected for a federal judgeship in 1986 over charges that he worked to resist civil rights changes in his home state. Democrats made a point of noting that Sessions during his confirmation hearing said the Voting Rights Act of 1965 is "intrusive."

But Sessions and his GOP supporters said Sessions also said he would enforce the law, and rejected the idea that he is an opponent of civil rights. Senate Judiciary Committee Chairman Chuck Grassley, R-Iowa, said just before the vote that Sessions was unfairly maligned in 1986, and that Democrats were trying to do it again 30 years later.

"Jeff Sessions' hearing in 1986 was an absolute ambush. In fact, it was a planned ambush," Grassley said. "He was unfairly attacked then, and he is being unfairly attacked now."

Sessions was better prepared this time around, and defended his record vigorously during his confirmation hearing last month. During that two-day hearing, Sessions denied allegations that as a U.S. attorney in the 1980s he targeted civil rights advocates and made racially inappropriate comments about the NAACP and minorities.

"There was an organized effort to caricature me as something that wasn't true," he told the Senate panel. "It was very painful. I didn't know how to respond and didn't respond very well. I hope my tenure in this body has shown you that the caricature that was created of me was not accurate. It wasn't accurate then and it's not accurate now."

Sessions also faced attacks for being too close to Trump, a president who has already been a frustration to most Democrats. Sessions was one of the first members of Congress to endorse Trump's presidential campaign, chaired Trump's national security advisory committee and advised Trump on the selection of his running mate.

In an all-night debate session Tuesday night, Democrats said it doesn't seem clear that Sessions would be able to enforce the law neutrally, and that he would be influenced by his ties to Trump.

Many Democrats are also worried about Sessions' stance on immigration, which calls for tougher border enforcement. Sessions was arguably the most vocal Senate opponent of former President Barack Obama's executive action on immigration, and he's expected to back Trump's call for the strict enforcement of immigration laws, and the rolling back of Obama's executive actions.

Trump's order to pause the entrance of refugees and immigrants from seven countries has already drawn outrage from Democrats, most of whom have said it's unconstitutional. Sessions will replace acting Attorney General Sally Yates, who was an Obama holdover who refused to implement Trump's order before quickly being fired by Trump.

A federal judge ordered a temporarily stay on the order, and Justice Department lawyers quickly argued for an end to that stay. A decision on that narrow issue is expected as early as Thursday, but Sessions is expected to play a key role in the administration's defense of the order.

Democrats aside, Sessions had numerous endorsements from law enforcement groups, including the Fraternal Order of Police, the largest police union in the country, and the AFL-CIO's International Union of Police Associations. Former attorneys general, like former Deputy Attorney General under President George W. Bush Larry Thompson, also offered their support of the nomination.

Sessions grabbed a huge endorsement Sen. Quinton Ross, the Democratic leader of the Alabama Senate and one of the highest-ranking black lawmakers in the state. Sessions racked up other critical endorsements, including former Secretary of State Condoleezza Rice and Tim Scott, the only black Republican in the Senate.

Most importantly, however, Sessions won unanimous support from his Republican colleagues in the Senate.

"Fair in action, bound to the Constitution, a defender of civil rights — this is the man we have come to know in the Senate," Majority Leader Mitch McConnell, R-Ky., said before the vote.