To longtime Jeff Sessions observers, the chaos that unfolded in American airports on Saturday morning wasn’t a surprise. At all.

Rather, the refugee ban was the predictable culmination of years of advocacy from two of President Donald Trump’s most trusted advisors: White House Senior Advisor Stephen Miller and attorney general designate Jeff Sessions. For years, Sessions and Miller—who was the Alabama senator’s communications director before leaving to join the Trump campaign—pushed research and talking points designed to make Americans afraid of refugees.

Press releases, email forwards, speeches on the Senate floor—Miller and Sessions used it all to make the case against Obama’s refugee program was a huge terror threat. The executive order Trump signed late in the day on Friday is just the logical conclusion of their work.

I started getting press releases that Miller sent on behalf of Jeff Sessions in March of 2013, shortly after I moved to D.C. to cover Congress. The emails went to my Gmail, and kept coming over the years—hundreds and hundreds of them. By the time he left Sessions’ office to join the Trump campaign, Miller’s press releases were legendary among Hill reporters: There were just so many of them, at all hours of the day, and they never stopped. Some were lengthy diatribes; some were detailed, homemade charts; some were one-liners; one was just a link to Facebook’s stock page on Google Finance with the subject line, “Does this mean Facebook has enough money now to hire Americans?”

“I wanted to put together a little book of the best emails I ever sent,” Miller told Politico last June. “I spent hours and hours of research on those.”

Some of that research had serious methodological problems, according to Alex Nowrasteh, an immigration expert at the libertarian Cato Institute.

“Miller’s work vastly overstates the threat of foreign terrorists to the homeland,” Nowrasteh said.

He pointed to Miller’s efforts to chronicle cases of refugees implicated in terrorist activity. It’s true that some refugees in the U.S. have been indicted for terrorism-related crimes, Nowrasteh said. But instances of refugees actively planning terror attacks on American soil, he added, were vanishingly rare.

“Almost all the refugees that I was able to specifically identify in his set were trying to support a foreign terrorist organization, mostly Al Shabab in Somalia, by giving them money or something like that,” Nowrasteh said. “I don’t know about you, but I think there’s a big difference between sending a militia in your home country funds and trying to blow up a mall in Cincinnati.”

The collective effect of Miller and Sessions’ messaging was to enthusiastically push a narrative that now dominates the Trump administration: that refugees and other immigrants steal Americans’ jobs, suck up too much welfare money, incubate terrorists in their communities, and, overall, are a big problem.

The conclusion was always the same: The government should let in far fewer refugees, and it should think twice about welcoming Muslims.

And now, that’s exactly what Trump is doing.

For instance, in one “Dear Colleague” letter that Sessions co-authored with conservative Republican Rep. David Brat—a letter Miller blasted out to his press list—the would-be attorney general ripped into the refugee program.

“There can be no higher duty as lawmakers than to keep our constituents and their families safe,” Brat and Sessions wrote. “Yet our reckless refugee programs, lax green card and visa policies, utter failure to enforce rampant visa overstays, along with our wide open southern border, put the U.S. at grave and needless risk.”

“Grave and needless risk”—it’s a view that clearly informs Trump’s decision to temporarily ban refugees.

And a Miller press release blasted out on Nov. 25, 2015, included this ominous title: “U.S. Issued 680,000 Green Cards to Migrants from Muslim Nations Over the Last 5 Years.”

Sessions then forwarded that email to his email list on Jan. 12, 2016, the day of Obama’s final State of the Union address, and added this note: “Some numerical context for any discussions of refugee policy that may arise tonight. As further context, the top-sending country for migrants are Iraq and Pakistan, according to Pew, ‘Nearly all Muslims in Afghanistan (99%) and most in Iraq (91%) and Pakistan (84%) support sharia law as official law.’”

The implication was clear as a bell: Muslim immigrants are flooding into the U.S., and they’re bringing Shariah with them. Someone who agreed with Miller’s assessment would do what Trump just did.

Just about any time a refugee living in the U.S. was charged, implicated, or otherwise connected to terrorism, Miller emailed his list about it.

Another Sessions press release, sent jointly with Sen. Richard Shelby, also included ominous intonations about refugees and Muslims.

“Congress must cancel the President’s blank refugee check and put Congress back in charge of the program,” Sessions and Shelby said. “We cannot allow the President to unilaterally decide how many refugees he wishes to admit, nor continue to force taxpayers to pick up the tab for the tens of billions of unpaid-for welfare and entitlement costs.”

“The omnibus would put the U.S. on a path to approve admission for hundreds of thousands of migrants from a broad range of countries with jihadists movements over the next 12 months, on top of all the other autopilot annual immigration—absent language to reduce the numbers,” the release continued.

That same statement also suggested that refugees were robbing elderly Americans of their benefits.

“Refugees are entitled to access all major welfare programs, and they can also draw benefits directly from the Medicare and Social Security disability and retirement trust funds—taking those funds straight from the pockets of American retirees who paid into these troubled funds all of their lives,” Sessions and Shelby said.

Now that Trump is president, those numbers are getting reduced—and fast.

Another foreboding subject line from Miller showed up in reporters’ inboxes on Nov. 20, 2015: “ICYMI: Each 5 years, U.S issuing more new green cards to migrants from Muslim nations the population of Washington, D.C.”

Sessions also took to the Senate floor to argue that Muslim immigrants are uniquely dangerous. On Nov. 19, 2015, the Alabaman said the following about Muslims:

“It is an unpleasant but unavoidable fact that bringing in a large unassimilated flow of migrants from the Muslim world creates the conditions possible for radicalization and extremism to take hold.”

In the speech, Sessions argued that the U.S. should set up safe zones in Syria where refugees could settle—instead of allowing any of them into the United States. Miller emailed reporters as Sessions spoke to highlight his argument. Now it’s Trump’s position.

At Breitbart, Julia Hahn covered Sessions’ speech in an article headlined “AFGHANISTAN MIGRATION SURGING INTO AMERICA; 99% SUPPORT SHARIA LAW.” News broke earlier this week that Hahn got a job in the White House as an assistant to Trump and senior advisor Stephen Bannon.

And on and on and on, for hundreds of emails, without even a whisper of flip-flopping.

Trump’s crack-down on Muslims and refugees shouldn’t surprise anyone. He’s just taking his advisors’ advice.