In the week before the mid-term elections, Donald Trump returned to his bread-and-butter issue: immigration.

He knows that the only thing that will turn out his base, and possibly swing some independents over to his side, is fear. Economic indicators are in reasonably good shape (for now). Hillary Clinton is nowhere near power (for now). He can’t use the threat of North Korea’s nuclear weapons because he’s already told Americans after the Singapore summit that they can sleep soundly (for now).

Ah, but a caravan of poor migrants, many of them women and children, fleeing violence and poverty — now that’s a threat.

It’s such a threat, in fact, that Trump announced that he will send as many as 15,000 U.S. troops to the border beginning this week. That’s about the same number of U.S. soldiers currently in Afghanistan. And the new deployment doesn’t count the border patrol and ICE personnel already positioned across from Mexico. The estimated cost of Trump’s plan is $200-$300 million, on top of the nearly $200 million in costs for dispatching the National Guard in May.

The caravan poses such a threat that Trump initially told the military that it should fire at anyone who throws a rock. “Consider it a rifle,” the president said. “When they throw rocks like they did at the Mexico military police, consider it a rifle.” Now, that might be how things are done in Israel, where the military has killed a number of people at the border with Gaza (with or without stones). But the U.S. military has responded that it operates according to the principle of proportional response. Rocks don’t equal bullets.

The caravan is such a threat that Trump’s political team put together a campaign ad that spuriously linked the murderer of a cop to the migrants fleeing violence. It ended with the message “Stop the caravan. Vote Republican.” The ad was so offensive that even Fox News refused to run it. NBC initially aired the ad, then had a change of heart and said it wouldn’t do so again. Trump personally pushed for this ad over the objections of aides who thought that a more upbeat message about the economy would be a better note on which to end the mid-term election campaign.

The caravan is such a threat that Trump made up ever more extravagant lies about it. At one point, he asserted that it contained mysterious Middle Easterners (it doesn’t). He claimed that Salvadoran gang members were part of the group (they aren’t). He accused the Democrats of wanting the caravan(they don’t). Then he said that the Democrats were inviting caravan after caravan to the United States (they aren’t).

Trump’s deliberate fabrications obscured the sad reality of the caravan. As Adam Serwer writes in The Atlantic:

In reality, the caravan was thousands of miles and weeks away from the U.S. border, shrinking in size, and unlikely to reach the U.S. before the election. If the migrants reach the U.S., they have the right under U.S. law to apply for asylum at a port of entry. If their claims are not accepted, they will be turned away. There is no national emergency; there is no ominous threat. There is only a group of desperate people looking for a better life, who have a right to request asylum in the United States and have no right to stay if their claims are rejected.

Trump’s attacks on the caravan are part of a larger effort to use immigration as the defining issue of his presidency. It’s his version of the Communist threat, which was not just about Soviet nukes but also the presumed infiltration of American society.

Immigrants serve that same dual purpose of mobilizing Americans against alleged threats both inside and outside America’s borders. In Trump’s distorted worldview, immigrants are not just massing on the other side of the Rio Grande but they’re already on the inside killing innocent civilians, taking jobs away from American workers, and creating dangerous gangs to destroy the fabric of society. For a president fixated on portraying politics in apocalyptic terms, the immigration issue is the perfect weapon.

So, for instance, the immigration issue produced the most provocative image of the 2016 campaign: the Wall. It generated the most incendiary issue of the first months of Trump’s presidency: the travel ban. The second year of his presidency was marked by the controversy over the separation of families at the border. And Trump has once again returned to the topic by attacking the caravan and broaching the possibility of ending birthright citizenship.

It is a deliberately polarizing strategy — to unify Trump’s base against the rest of the country.

According to Gallup polling in October, immigration ranked as the second most important issue for Republicans, just a hair behind the economy, and second highest for all eligible voters. It’s a strategy deliberately crafted to drive a wedge right into the immigrant community itself — with some older immigrants standing with the president against undocumented workers and some Asian Americans siding with the Republican Party on its anti-affirmative-action stance.

On the eve of the elections, it didn’t appear to be a winning strategy. According to pollsters Peter Enns and Jonathon Schuldt, Trump’s attacks on the caravans had no statistical impact on voting preferences by the end of October. Nor did it seem to motivate his Republican base to turn out. It didn’t even seem to make likely voters more anti-immigrant. Democrats, at least in House races, were having more luck persuading voters with their emphasis on health care.

But even if immigration didn’t prove effective nationwide as an electoral strategy, it does seem to have an impact on a local level. In Arizona, for instance, immigration is a top issue. If Republican Martha McSally preserves her narrow lead over Democrat Kyrsten Sinema in the Arizona Senate race, the Republican’s hardline immigration position may have been the deciding factor. On the other hand, Republican David Brat used immigration as a key issue to win an upset victory four years ago against House Majority Leader Eric Cantor. In yesterday’s election, he lost a nail-biter to Democrat Abigail Spanberger. In the Virginia suburbs at least, health care proved to be more of a motivating issue than immigration.

But Trump isn’t thinking just about the mid-term elections. He wants to create an atmosphere of chaos and panic that allows him to act more forcefully (sending troops), speak more rashly (terrorists are coming!), and present himself as the country’s savior (apres moi, le deluge). He’s a grandstanding nationalist who has finally found his calling: to preserve white dominance in the United States and prevent the country from becoming part of a multicultural world.

It’s also a patently racist strategy, though Trump himself doesn’t care what color you are as long as you show absolute loyalty to him. It’s racist not only because of the anti-immigrant animus that it generates. It’s racist because the only way Trump and the GOP can win is through racial gerrymandering and voter suppression in non-white communities.

The mid-terms are over. The Democrats have regained the House and lost ground in the Senate. It’s going to be messy here in Washington as the partisan battles intensify.

But the administration’s game plan is clear for the next two years. Trump has found the one issue that can unify his domestic and foreign policies. The caravan is only the latest example of the president’s efforts to use fear and racism to galvanize his base. By 2020, voters will be deciding not just who occupies the White House. They’ll be voting on what it means to be an American.

John Feffer directs Foreign Policy In Focus at the Institute for Policy Studies.