U.S. Senate has confirmed President Donald Trump’s nomination for attorney general, Alabama Senator Jeff Sessions, by a vote of 52 to 47.
The confirmation follows a series of divisive hearings during which Democrats attacked Sessions’s record on civil rights.
Democrat Elizabeth Warren was silenced after recalling historic allegations of racism against Sessions.
The Alabama senator’s nomination was among Trump’s most controversial.
Voting largely followed party lines, with just one Democratic senator – Joe Manchin of West Virginia – voting for Sessions.
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 US attorneys.
Addressing the chamber after the vote, 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,” Sessions added.
“I fully understand the august responsibility of this office.”
But Sessions added that “denigrating people who don’t agree with us is not good for our politics”.
During debates ahead of the vote, Warren and other Democratic senators recalled criticism of Sessions by Martin Luther King’s widow, who opposed his nomination as a federal judge in 1986, alleging he had intimidated black voters.
That nomination was rejected by a US Senate panel amid concerns over allegedly racist comments made by Sessions, and remarks which appeared to be sympathetic to white supremacist group the Ku Klux Klan.
David Duke, the former leader of the the KKK, welcomed the confirmation, writing on Twitter: ” Trump’s appointment of Bannon, Flynn and Sessions are the first steps in the project of taking America back.”
Warren, who was temporarily banned from the chamber, wrote: “If Jeff Sessions makes even the tiniest attempt to bring his racism, sexism & bigotry into the Justice Department, he’ll hear from all of us.”
At 70, Sessions is the same age as Trump and was an early supporter of the president.
Trump has lashed out on Twitter at Democrats stalling his cabinet picks, including Sessions, who is only the sixth of Trump’s 15 nominees to be confirmed.
The Alabama senator is widely seen as an inspiration for Trump’s anti-immigration policies and his close ties to the president and special adviser Steve Bannon have raised concerns about his ability to be sufficiently independent from the White House.
The confirmation follows a turbulent first fortnight for Trump, during which the president has faced heavy criticism over his controversial travel ban and a raid in Yemen which killed one US navy operative and a number of civilians, including children.