The confirmation follows a series of divisive hearings during which Democrats attacked Mr. Sessions's record on civil rights, the BBC wrote.
Democrat Elizabeth Warren was silenced after recalling historic allegations of racism against Mr. Sessions.
The Alabama senator's nomination was among Mr. Trump's most controversial.
Voting largely followed party lines, with just one Democratic senator – Joe Manchin of West Virginia – voting for Mr. Sessions.
Read alsoThe Washington Post: Why 'spheres of influence' bring war closerMr. Sessions's Republican colleagues in the chamber applauded him as their majority carried him over the line. He will now take charge of the justice department and its 113,000 employees, including 93 U.S. attorneys.
Addressing the chamber after the vote, Mr. Sessions said: "There is no greater honour than to represent the people of Alabama in the greatest deliberative body in the world.
"I appreciate the full debate we've had and thank those afterwards who found sufficient confidence to cast their vote to confirm me as the next attorney general.
"I fully understand the august responsibility of this office."
But Mr. Sessions added that "denigrating people who don't agree with us is not good for our politics".