The "Leave" campaign won the British referendum on Brexit last week by talking more like Donald Trump.

Now, Trump is talking more like the Brexit campaign.

In a speech on Tuesday he said, "Our friends in Britain recently voted to take back control of their economy, politics, and borders. I was on the right side of that issue — with the people — while Hillary [Clinton], as always, stood with the elites, and both she and President Obama predicted that one wrong. Now it's time for the American people to take back their future."

Trump has celebrated Brexit as an unmitigated victory. "Leave" supporters like Boris Johnson (the likely next prime minister of the UK) borrowed from America and other former British colonies by calling the Brexit vote the UK’s "Independence Day." Trump, in his speech, asked voters to imagine "how much better our future can be if we declare independence from the elites," too.

But Trump isn’t just echoing the Leave campaign. He, or someone in his camp, is watching. And learning.

At the same time that Trump’s cast his campaign and Brexit as two expressions of a transnational populist revolt among globalized, deracinated elites, he’s dialing back his boldest promises to restrict immigration into the US — the issue on which both he and the Leave campaign really gained traction.

Trump has reason to be wary: Only after Leave won the vote did it become clear that the politicians who pushed for it didn’t really have any ideas about how to proceed, or any way to keep the lofty promises they’d made to their supporters.

Now that Donald Trump is getting the chance to see what actually happens after someone wins a campaign like the one he’s running, he’s learning from the Brexiters’ (and his own) mistakes.

When economic anxiety is a script for racial anxiety

When it comes to policies, Donald Trump is an old-school populist. He supports protectionist trade policies and nativist immigration policies — supporting people in the US rather than an abstracted global economy. His rhetoric targets both suspicious outsiders who could be coming to steal your gains, and — increasingly, as he turns his fire on Hillary Clinton for the general election — the unaccountable transnational elites who feed off your labor.

Trump didn’t invent this combination of messages. He just reanimated them at a time when Democrats had fully embraced cultural cosmopolitanism and Republicans fully embraced global capitalism. Neither party was quite used to politicians being so direct (and effective!) as Trump was about the cultural threat he believed immigrants pose.

American political discourse has extremely strong taboos right now against open discussion of race, and Trump broke those. But it also has strong taboos against open discussion of racism. So the conversation about Trump’s populism got stuck in a back-and-forth over whether economic anxiety or racial anxiety was the "real" key to Trump’s success (with the subtext that, if the latter were true, it would be fair and necessary to call his followers racists).

By the same token — partly due to the fact that few elite commentators predicted the UK would vote to leave the EU, and partly because much of the strongest support for Leave came from places that typically supported the center-left Labor Party — the conversation about the Brexit vote has gone down the same alley. Were Leave supporters voting out of xenophobia, or were they voting to reject the EU’s unaccountable government and market evangelism (or, if you prefer, its overregulation)?

The answer is of course that populism is driven by both economic and racial anxieties. But it’s not just that — the two types of anxieties play on each other. And when politicians and their supporters recognize that the two of them are related, it’s possible to invoke both kinds of anxiety while only talking about one of them.

When Donald Trump says "America First," or when establishment Leave campaigners like Boris Johnson and Dan Hannen said "take back control," they were explicitly talking about nonracial issues like trade and sovereignty. But their followers got the message.

Anxieties about immigration are extremely potent — which means it’s dangerous to make campaign promises about them

For much of the Brexit campaign, the Leave side was running on just that message — the economic-focused sovereignty one. It’s unlikely that they would have won the referendum that way. Much of the momentum of the campaign came in the last several weeks, when the focus shifted to immigration — and the right-wing politician Nigel Farage became a de facto spokesman for leaving the EU.

Farage’s style is similar to Trump’s: the willingness to blame immigrants for things, the importance of big splashy images over accuracy, the ability to acknowledge anger and potential violence in a way that seems to excuse them. And Farage was willing to drive the point home: Britain needed to reduce immigration to protect itself, and it needed to take back control of its borders to do it.

That message, especially in conjunction with the anti-elitist EU message, was a very potent one for a lot of people. Leave did better in the polls during the later, immigration-centered phase of the campaign, and ultimately won.

For Brexit-supporting politicians, that’s when the trouble started.

Johnson and company have had to make several awkward confessions over the last several days: Their core promise to fund the NHS was an exaggeration at best; they didn’t actually have a plan, particularly, to formally sunder the UK from the EU.

But among the most awkward has been the expectations game they’ve been playing with their supporters on immigration: trying desperately to lower any expectation that a victory for Leave meant significant reductions in migration into the country. Unsurprisingly, it turns out that voters who backed Leave because they wanted fewer immigrants in the UK aren’t super-receptive to the idea that Leave doesn’t mean fewer immigrants will come to the UK.

@DanHannanMEP @PaulDBrant @jreedmp I DON'T CARE WHAT YOU SAID MR HANNAN. WE JUST VOTED TO STOP MASS IMMIGRATION. NOW DELIVER FOR US. — VoteLeave Derbyshire (@DerbyshireLeave) June 25, 2016

Populism (like any ideology) is both expressive and prescriptive: a diagnosis of the problems we face today and a plan of action to fix them. The prescriptive part is where politicians run into trouble with campaign promises. The obvious answer, then, is to focus on the expressive part — and galvanize support simply by naming the right problems.

Simply voting against elites is an expressive act. Perhaps it doesn’t actually require you to leave the EU at all, actually. It just means you’ve sent a message that you don’t like them very much.

By the same token, when Trump makes promises to renegotiate trade deals and prevent offshoring, he’s simply promising to hold the right enemies accountable. He’s not making any promise so firm he can be called out later if he doesn’t follow through.

More importantly, he’s managed to win the loyalties of his core supporters by talking openly about racial anxieties, and then sublimate that message into a more broadly palatable one. Trump’s fans are his fans — it’ll be interesting to see if they feel betrayed by Trump’s backpedaling on the Muslim ban, but they may very well find a way to forgive it. As always, the people most invested in a savior will project their own desires onto him. That’s how culture wars work.

The lesson Trump appears to be learning from the Leave campaign is that it got the order wrong. Leave tried out a broadly appealing non-racialized message led by Boris Johnson first; the anti-immigrant messaging of Farage ended up carrying the news cycle in the campaign’s home stretch. Trump has already been Farage. He won the GOP nomination as Farage. Now he’s trying to be Boris Johnson.