Trump’s choice, Alabama Senator Jeff Sessions, confirmed after accusations of racism and strong resistance.
The US Senate has confirmed Senator Jeff Sessions as attorney general despite fierce debate over his civil rights record and a push by Democrats to block him.
President Donald Trump’s choice was given the greenlight on Wednesday by a vote of 52-47.
Sessions had faced accusations of racism, and a Senate panel rejected him for a federal judgeship in 1986 amid concerns over allegedly racist comments he had made.
"This caricature of me from 1986 was not correct," Sessions said after his confirmation hearing last month.
"I deeply understand the history of civil rights ... and the horrendous impact that relentless and systemic discrimination and the denial of voting rights has had on our African-American brothers and sisters".
On Tuesday, Democratic Senator Elizabeth Warren, a darling of the political left, was silenced in the Senate for reading a 1986 letter from Coretta Scott King, the widow of the Rev Martin Luther King Jr, that criticised Sessions for his civil rights record.
Democrats, civil rights and immigration groups have voiced alarm about Sessions’ record of controversial positions on race, immigration and criminal justice reform.
A known immigration hardliner, he will take over the Justice Department as its lawyers are defending Trump’s temporary entry ban on people from seven predominantly Muslim countries and all refugees, the most controversial executive order of the young administration.
The 9th US Circuit Court of Appeals is due to rule this week on whether to overrule a district court judge in Seattle who suspended the ban last week.
READ MORE: Who are Donald Trump’s cabinet picks?
Senate Majority Leader Mitch McConnell, a Republican, praised Sessions as honest and fair.
"This is a well-qualified colleague with a deep reverence for the law. He believes strongly in the equal application of it to everyone," he said.
Sessions, who is originally from Alabama, will serve as the 84th US attorney general. The 70-year-old was an early Trump supporter who became a pivotal figure in his campaign and transition team. He served as a prosecutor from 1981 to 1993, and won a seat in the Senate in 1996.
Senate Democrat Chris Murphy said he was "scared" about changes Sessions could bring.
"[His ] history of opposing civil rights, anti-gun violence measures and immigration reform makes him uniquely ill-fitted to serve [as attorney general]," Murphy said.
"I want a chief law enforcement official that will be a champion of the disenfranchised and dispossessed, not a defender of discrimination and nativism."
Former vice presidential candidate Timothy Kaine, also a Senate Democrat, said Sessions’ record raised doubts.
"Any attorney general must be able to stand firm for the rule of law even against the powerful executive that nominated him or her," Kaine said. "In this administration I believe that independence is even more necessary."
Trump was quick to congratulate Sessions on Twitter:
Sessions will assume office a week after acting Attorney General Sally Yates was removed by Trump for refusing to defend his travel ban.
With the attorney general in place, eight of Trump’s 22 Cabinet nominees have been confirmed.