Ever since he was a teenager in progressive Santa Monica, Stephen Miller was a troublemaker.

“If you’re a conservative in a place like that, you’re inevitably a contrarian,” said Mark Krikorian, a leading activist for a stricter immigration system. “And with this election cycle, that was a good thing to be.”

Miller will soon enter the White House as the senior adviser to the president for policy, an extraordinary accomplishment for a 31-year-old.

He is as versatile as he is polarizing. A consistent theme in his life is knowing how to poke his political opponents in the eye, and he has seemed to revel in the feeling—from his childhood, to his college years, to the presidential-campaign trail.

Miller has served as the Swiss Army knife of political aides: writing speeches, including reportedly contributing to the forthcoming inaugural address; developing policy, especially on Trump’s signature issue of immigration; and serving as a Trump hypeman on the campaign trail.

His impact will be felt now more than ever, as he plays a key role in shaping Trump’s first words to the nation as president after he is sworn in Friday.

The conservative firebrand graduated from Santa Monica High School in California, a liberal bastion that has only produced another White House aide of note: Nixon staffer John Ehrlichman, a central figure in the Watergate scandal who was later sent to prison for it.

It was in high school that Miller began honing his irreverent opinions and Trumpesque bluntness, neither of which were especially appreciated in the progressive environment of his upbringing.

“The reason that these [Islamic] countries are poor and failing is because they have refused to embrace the values that make our country great,” Miller wrote in an op-ed for his high-school newspaper after the 9/11 attacks, titled “A Time to Kill.” “If they would adopt policies of personal choice, free enterprise, and democracy, their status would greatly improve.”

Ari Rosmarin, now a civil-rights attorney, was in the class ahead of Miller and the editor of the Santa Monica High School paper at the time.

“Most people knew him because he made it his business to have everyone hear his vile rhetoric on a regular basis… that made it impossible not to know him,” Rosmarin told The Daily Beast. “People laughed at him because he was a buffoon, he was a performer, he thrived on spectacle. I’m very conscious now, looking back, that he was treated the same way that Trump was—he wasn’t taken seriously.”

But it wasn’t just conservative thinking that alienated many of his classmates, nor merely his opposition to Spanish-language announcements at the school. It was also what some saw as a mean streak. In one instance, described by Rosmarin, he ran for a student-body leadership position, delivering a speech in which he complained that students were told to put their trash in garbage bins, when janitors were hired for the purpose of cleaning.

“He was booed unanimously by the student body off the stage. People were disgusted by it… [It] was not just that he targeted minority students, and played a victim on a regular basis, but was an asshole,” Rosmarin said. “That kind of incident with the janitorial staff—everyone, no matter what your background is, understands why that is an awful thing to say.”

His time in college was even more controversial: He wrote some 20 columns for the Duke Chronicle, with themes familiar today.

He blasted “unpatriotic dissent,” political correctness, and the nanny-state smoking bans. “Richard Spencer, a leading white nationalist, said the two became acquainted while they were both at Duke, adding that he was a “mentor” to the younger student.

“I spent a lot of time with him at Duke… I hope I expanded his thinking… but I think he probably would be where he is today without me as well,” Spencer said, adding that he felt Miller was a “highly competent person, and a brave person.”

Spencer has since coined the term “alt-right” to describe his movement of racial discontentment. While they were friends, they did not see eye to eye on race, Spencer claims.

“I think [Miller] is an American nationalist, but that doesn’t mean he is a racial nationalist… I do not think he is a white nationalist,” Spencer said. “Stephen Miller would never be alt-right at the time, or probably now too.”

However, Spencer, who was a history graduate student while Miller was an undergraduate, said that the two of them had worked to bring white-nationalist writer Peter Brimelow to campus together, something first reported by Mother Jones.

The two lost touch around five years ago, Spencer now says. And Miller disavowed Spencer last year, telling The Daily Beast about Spencer’s claim of mentorship that “his comment is totally false and obviously ludicrous… I strongly condemn his views.”

Miller first emerged on the national stage while at Duke, appearing on television to defend three lacrosse players who were accused of rape. They were later cleared of wrongdoing.

“I definitely knew that he was going to make something of himself. And I’m not surprised that he’s a public figure,” Spencer said. “I think the Duke lacrosse case proved that. He came out swinging when that controversy went down, and he was really adept at the media.”

His conservatism activism would lead to writing opportunities, and eventually to political jobs. He first appeared on Capitol Hill as a staffer for Rep. Michele Bachmann. Later, he served as an aide to Republican Sen. Jeff Sessions of Alabama, a spot that no one would have pegged as a path to an influential White House gig one day, since Sessions was not then a particularly powerful lawmaker.

“He is a guy who considers himself a firebrand and fits into the anti-establishment mold that way. He was very wonkish on immigration and he likes to throw bombs,” said Ben Shapiro, a commentary writer who was a young conservative growing up in the Los Angeles area around the same time as Miller.

During his time with Sessions, Miller became single-mindedly focused on immigration—he certainly was passionate about it: In 2014, he was spotted by one attendee at a conservative event, discussing immigration for hours on end with his then-boss Ann Coulter.

That year, he spent most of his time promoting Sessions’s efforts to kill the immigration reforms known as the “Gang of Eight” bill during President Obama’s second term, an effort that was ultimately successful. Fighting against establishment Republicans, the U.S. Chamber of Commerce, large segments of the GOP donor base, House Republican leadership, and most of the Democratic Party apparatus, the reform effort failed—due in substantial part to Miller’s work.

“He used our research because he was doing the senator’s public outreach, running the staff side of the senator’s fight against the Gang of Eight amnesty,” said Krikorian, who leads the Center for Immigration Studies, a group that advocates for more restrictive immigration. “He’s extremely smart and extremely driven.”

During the Trump presidential campaign, then-Breitbart head Steve Bannon—soon to become a senior counselor to the president—introduced Miller to Sam Nunberg, a Trump aide.

Miller’s work opposing the Gang of Eight immigration-reform package impressed Nunberg, who says he first mentioned Miller’s name to Trump. Then-campaign manager Corey Lewandowski would later hire Miller, Politico reported.

Even with the death of comprehensive immigration reform, Miller was laser-focused on taking down immigration-reform proponents like Marco Rubio, who was then also running for the Republican nomination and a member of the Gang of Eight.

“One thing that impressed me about Stephen was when we were in a [Republican] field of 17 or 16, Stephen was so focused on Marco Rubio, because of the Gang of Eight bill,” Nunberg told The Daily Beast. “That was a point where Rubio was at 3 percent. I was more concerned with Jeb Bush or Scott Walker.”

Miller read the winds correctly, and joined the Trump campaign in January 2016. And soon after, he was warming up raucous campaign crowds for Trump, in front of thousands of people.

“He bet on the right horse, and it’s one of those things where if you come to a campaign early, you’re an early adopter and you move to the top,” Krikorian said. “He saw an opportunity to help a candidate who was concerned about the issues he cared about, and took a chance.”

Eventually, Miller also proved willing to eviscerate even those who generally agree with him on immigration, like Sen. Ted Cruz.

“Ted Cruz is a radical Wall Street globalist who will rip the beating heart of manufacturing out of the United States of America,” Miller said at a rally in the spring of 2016. “Ted Cruz sided with Goldman Sachs and the globalists over the issue of trade… We can not let that happen.”

But with the Iowa caucuses now a year behind us, the Cruz team sounds willing to let bygones be bygones.

“Of course, we were on competing campaigns,” said Cruz spokesperson Catherine Frazier. “But we also worked very closely with him and Sessions’s staff previously in the Senate. He was a pro and pleasure to work with. He’ll be a great asset to the White House.”

Miller played a key role in drafting Trump’s acceptance speech at the Republican National Convention, with its dark themes of rising crime, the dangers of immigration, and the “I alone can fix it” message. The aide will reportedly also be drafting Trump’s inaugural address on Friday, although President-elect Trump has since said that he will be writing it himself.

The Trump transition team did not respond to a request for comment for this article.

Miller is barely old enough to pass the constitutional age requirement to run for the Senate. But in days, he will be the right-hand man to the president of the United States on policy issues. His conservative allies say he’s ready.

“Stephen is mature and wise beyond his years—and humble,” said Laura Ingraham, a friend and conservative talk-show host. “We need more of him in Washington.”

Still, Miller’s boosters concur his role in the White House will be that of an ideological diehard, pressing the president to stay true to his campaign promises.

“I think he’s an asset to Trump in terms of helping the Trump administration keeping the flame of what they got elected on, in the states they carried, like Pennsylvania, Michigan, and Wisconsin,” said Nunberg. “He knows how to communicate to that group, and the good news is he actually believes it—unlike some political operatives.”