The 52-47 vote was mostly along party lines, though one Democrat, Sen. Joe Manchin, joined the Republicans to back their Alabama colleague.
The final vote for Sessions -- one of Trump's closest advisers and his earliest supporter in the Senate -- came after 30 hours of debate from Democrats and a stunning fight between liberal Sen. Elizabeth Warren and Senate Republicans which ended in her being forced to sit down after she was accused of impugning Sessions.
Sessions said he would resign from his office 11:59 p.m. Wednesday and the White House is scheduled to swear him in Thursday morning.
"It was a special night," Sessions told reporters on Capitol Hill after his confirmation. "I appreciate the friendship from my colleagues -- even those who, many of them who didn't feel able to vote for me. They were cordial, and so we continue to have good relations and will continue to do the best I can."
The fight over Sessions nomination spurred some of the most jarring, and at times personal attacks, rooted in allegations that Sessions was a racist -- claims the Alabama senator and his supporters have fiercely denied. Even early in the nomination process, one of Sessions' colleagues, Cory Booker, became the first sitting senator to testify against another sitting senator during his confirmation hearing.
Shortly before the vote, Senate Majority Leader Mitch McConnell took to the Senate floor to sing the praises of Sessions, after Democrats spent hours criticizing him.
"He's just a likable guy, one of the most humble and most considerate people you'll ever meet," McConnell said. "He's a true Southern gentleman."
While some left-leaning groups issued statements promising to stand up and continue raising awareness about their disagreements with Sessions, Republican Sen. Jim Inhofe questioned how effective they could be in trying to keep up the fight.
"What are they going to do? He's the attorney general. Where does the fight start? Where's the ammunition?" He said to reporters.
In the debate Tuesday evening, after Republicans already blocked a Senate filibuster, Warren reignited that debate by reading from a 1986 letter Coretta Scott King sent opposing Sessions for a federal judgeship.
"'Anyone who has used the power of his office as United States Attorney to intimidate and chill the free exercise of the ballot by citizens should not be elevated to our courts,'" Warren read from King's letter. McConnell accused Warren of impugning Sessions on the Senate floor -- a violation of Senate rules -- and after a series of procedural votes, she was forced to sit down and stop debating.
Warren's censure and subsequent reaction continued to largely overshadow the Sessions fight in the hours before his vote, but the Massachusetts Democrat told CNN's Manu Raju said Sessions, whom she served with in the chamber, is just the latest example of a poor Cabinet choice.
"We may not have the votes to stop him," she said, "but we sure as hell need to make it clear to the Republicans and to the American people exactly who Donald Trump is putting in charge of our government."
Sessions was ultimately blocked from a federal judgeship and carried that battle scar into Wednesday's final confirmation battle.
Democrats not done yet on nominees
Democrats are expected to repeat the same 30-hour debate plan for Health and Human Services Secretary nominee Tom Price and could easily drag the fight over Treasury pick Steven Mnuchin into the weekend.
Tuesday, Betsy DeVos was confirmed, 51-50, in a battle that sparked impassioned protests and the flooding of Senate switchboards by angry Democrats and liberal activists.
The tactics have yet to work in actually defeating any of Trump's Cabinet picks, but they have fired up a base of Democratic and liberal activists irate over a series of Trump actions, not least of which was picking a Republican mega-donor in DeVos to run the Department of Education.
"When you get millions of calls and demonstrations and a nominee is exposed for being who they are, it's going to have a profound and positive effect, even if she gains office. So we're very happy with the results and we're going to continue them," Senate Democratic Leader Chuck Schumer said Tuesday.
But Republicans have chafed at what they call "historic obstruction" and have argued that Trump needs his team in place.
"This is the slowest time for a new Cabinet to be up and running since George Washington. This level of obstruction at the beginning of an administration is really record-setting in a very unfortunate way. It's really time for our friends on the other side to get over the election, let this administration get up and get running," McConnell said Tuesday.
The only nominee who appears to be in any trouble at this point is Labor secretary pick Andrew Puzder, who is embroiled in controversy following news that he hired an undocumented worker to clean his house and was forced to pay back taxes. A series of Republicans on the Senate panel tasked with vetting him declined to say Tuesday whether they still supported Puzder.