Sen. Jeff Sessions (R-Ala.) arrives at Trump Tower on Monday in Manhattan. (Evan Vucci/AP)

The allegation that Sen. Jeff Sessions (R-Ala.) has said racially insensitive things has haunted President-elect Donald Trump's pick for attorney general throughout his career.

In fact, it almost derailed it. In 1986, Sessions was a 39-year-old U.S. attorney for Alabama when President Ronald Reagan's administration nominated him to serve as a federal judge.

The position requires approval from the Senate. And as Sessions settled in for review by the Senate Judiciary Committee, his career in law was almost destroyed when former colleagues brought forward troubling accusations about things Sessions had said to them with regard to race.

The accusations mostly came from (but were not limited to) Sessions's former deputy, Thomas Figures. He sent a letter to the Senate and reporters claiming his boss said insensitive things about black people, at times directly to him.

Figures, who is black, said Sessions told him to be careful about what he said ''to white folks” after Figures got into a heated argument with a white colleague. And Figures testified Sessions called him “boy” on multiple occasions.

Figures also said Sessions had joked about the Ku Klux Klan, saying he thought its members were “okay, until he learned that they smoked marijuana.”

A Justice Department lawyer, J. Gerald Hebert, testified that Sessions had described the NAACP and the American Civil Liberties Union as “un-American” and “Communist-inspired.”

As he has his whole career, Sessions vigorously denied that he had or has any racial prejudice. Though he didn't specifically deny making any of the comments ascribed to him, Sessions told the Senate committee he had been quoted out of context.

The New York Times reported at the time: “Sessions acknowledged at the hearing that he once 'may have said something about the N.A.A.C.P. being un-American or Communist, but I meant no harm by it.'”

“I am not the Jeff Sessions my detractors have tried to create,” Sessions testified. “I am not a racist. I am not insensitive to blacks.”

The damage, however, had been done. By the time the testimony was finished, Sessions's “reputation was in tatters,” wrote Isaac Stanley-Becker in The Post this July.

Sen. Joe Biden (D-Del.), then the leading Democrat in the Senate Judiciary Committee, told the New York Times that after hearing Sessions's accusers out, his prospects for a nomination were “bleak” and Sessions appeared unfit for a federal judgeship.

In the end, the Republican-controlled committee voted 10 to 8 to block Sessions's nomination, with two Republicans joining Democrats to stop it from going forward to a full vote in the Senate. At the time, CNN calculated, Sessions was only the second nominee in 50 years to be denied by the Senate for a federal judgeship.

Sessions returned home, defeated but not destroyed. He went on to become attorney general of Alabama in 1994, and just two years later he was elected to the U.S. Senate, where he has been ever since. He is quite popular in his home state: In subsequent reelections, Sessions has never won with less than 59 percent of the vote. In 2014, he ran unchallenged.

In the ultimate ironic twist, Sessions now sits on the very same Senate committee that rejected him.

Every so often, Sessions has reflected on that moment 30 years ago that almost destroyed his career. He told CNN in a 2009 interview that the accusations against him were “heartbreaking.” And he told Stanley-Becker this summer: “Racism is totally unacceptable in America. Everybody needs to be treated fairly and objectively.”

Sessions hasn't been mired in a controversy since about his comments on race. But critics point to his voting record and the causes he has championed in the Senate to claim that Sessions harbors racial prejudice: He is one of the Senate's most hard-line anti-immigration lawmakers, and he has opposed the Voting Rights Act.

The Southern Poverty Law Center's Heidi Beirich, who tracks hate speech, told Stanley-Becker that Sessions is guilty of it, and that his mere presence in Trump's inner circle is “a tragedy for American politics.”

Hebert, the former Justice Department lawyer who testified against Sessions in '86, told the New York Post on Friday that "anybody who'd really put Jeff Sessions as head of the Justice Department with his record is not interested in uniting the country but dividing it further."

On the flip side, anti-illegal-immigration and immigration-reduction groups congratulated Sessions on the coming nomination.

It’s not clear whether the next time Sessions will sit before a Senate panel to be considered for a nomination — likely early 2017 — will shape up to be nearly as bumpy for him.

Sen. Chuck Grassley (R-Iowa), the current chairman of the Senate Judiciary Committee, was among a number of Senate Republicans praising Sessions’s fitness for the job.

But the soon-to-be top Senate Democrat, Sen. Chuck Schumer (D-N.Y.) sounded an ominous tone about Sessions:

I know Senator Sessions and we work out in the gym, but the fact that he is a Senator does not absolve him from answering tough questions in the confirmation process. Given some of his past statements and his staunch opposition to immigration reform, I am very concerned about what he would do with the Civil Rights Division at the Department of Justice and want to hear what he has to say.

And key Senate Democrats on the Judiciary panel, such as California's Dianne Feinstein, are taking a much more cautious approach, essentially keeping their options open into how hard they want to go after Sessions for his troubles in '86.

And here's outspoken liberal icon Sen. Elizabeth Warren (D-Mass.)

No matter how vigorously he denies accusations of racial prejudice, it seems, Sessions has been unable to live down what some of his colleagues said about him 30 years ago. And as Trump's pick to be the top U.S. law enforcement officer, the story that haunts him has come roaring back to life.