According to reports from CBS News, President-elect Donald Trump has named Alabama Sen. Jeff Sessions to serve as attorney general in his upcoming administration.

The appointment would put Sessions in a powerful position to turn Trump’s promises of aggressive immigration enforcement and reduced federal oversight of police into reality. It would also help the Trump administration turn its campaign crusade against “voter fraud” into federal policy that would help states reduce voting opportunities.

But Sessions will have to be confirmed by the Senate first. And he’s already failed that test once, thanks to comments he made early in his career that seemed sympathetic to the Ku Klux Klan.

Sessions went from GOP dissenter to close ally of the president-elect

Sessions has been a key adviser to the Trump campaign from very close to the beginning. He was the first member of the US Senate to endorse Trump. Even before then, he played a key role in the development of Trump’s immigration platform — if he and his staff didn’t write the platform themselves, it certainly bore more resemblance to ideas that Sessions had been advancing as head of the Senate Judiciary Committee’s subcommittee on immigration than it did to Trump’s own comments on the subject.

Throughout the campaign, he was willing to serve as a surrogate to defend some of Trump’s worst moments. After the leak of a 2005 Access Hollywood tape in which Trump bragged about being able to grab women “by the pussy,” Sessions said, “I don’t characterize that as sexual assault.”

His influence with Trump appears to have only grown since the election. The transition team shake-up last week, in which Vice President-elect Mike Pence replaced New Jersey Gov. Chris Christie, was seen as a sign of Sessions’s rising power: His chief of staff was named executive director for the transition, and a former aide of his, Stephen Miller, is its national policy director.

In an article this week about Trump’s “concentric circles” of advisers, Philip Rucker and Robert Costa of the Washington Post characterized Sessions as one of Trump’s “intimates,” along with chief strategist Steve Bannon and son-in-law Jared Kushner — saying Sessions’s “clout is all-encompassing and often unseen.”

Just a few years ago, this would have been unimaginable. Sessions has distinguished himself in the Senate for his hard-line stance against both legal and unauthorized immigration (while other members of the GOP pushed for reform) and for his steadfast “tough-on-crime” policies (while a younger generation in the party embraced reductions in mandatory minimums and other criminal justice reform measures). But over the past few years, Sessions has seen these views go from controversial within his own party to the core of the message that won his close ally the White House.

If Bannon is the intellectual godfather of many of Trump’s views, Sessions was the policy progenitor of Trump’s White House.

Sessions’s views on race kept him from getting confirmed to a federal judgeship in 1986

So far, outrage over the incoming Trump administration has focused on Steve Bannon — who, in the words of my colleague Zack Beauchamp, “spent years mainstreaming white nationalism” as head of Breitbart, and whom Trump has appointed to a “chief strategist” role equal in importance to chief of staff.

Democrats in both chambers of Congress have strongly condemned Bannon’s hire; Republicans have fielded thousands of calls from angry progressives. But Bannon won’t need to be confirmed by the Senate. Sessions, as a Cabinet secretary, would.

And Jeff Sessions has run into trouble getting confirmed by the Senate before.

Back in 1986, 39-year-old Jefferson Beauregard Sessions III (then a federal prosecutor) was nominated to a federal judgeship by Ronald Reagan. As this 2002 New Republic article and this more recent article from the New York Times recount in detail, his confirmation hearings before the Senate Judiciary Committee went … poorly.

First, a witness said Sessions had called the ACLU and NAACP "un-American" for “trying to force civil rights down the throats of people” — and Sessions confirmed that (as paraphrased by the New Republic) “such groups could be construed as ‘un-American’ when ‘they involve themselves in promoting un-American positions’ in foreign policy.” Then the witness said Sessions had responded to a story about a judge calling a white lawyer a “disgrace to his race” for representing a black client with “well, maybe he is.”

Then this happened, in the words of the New Republic:

A black former assistant U.S. Attorney in Alabama named Thomas Figures testified that, during a 1981 murder investigation involving the Ku Klux Klan, Sessions was heard by several colleagues commenting that he "used to think they [the Klan] were OK" until he found out some of them were "pot smokers." Sessions claimed the comment was clearly said in jest. Figures didn't see it that way.

Sessions was not confirmed to the judgeship. He (eventually) went to the Senate, and the Senate Judiciary Committee, instead.

Now, President-elect Trump is trying again. The bet he’s making is that the Senate of 2016 cares less about the racial views of someone tasked with, among other things, upholding federal civil rights law than the Senate of 1986 cared about the race views of a federal judge. It remains to be seen whether Sessions’s colleagues will prove Trump right.