In the final days before the midterm elections, President Trump has turned his focus to the topic with which he has closed out all the campaigns he’s engaged in since his presidential effort began in 2015: an angry, nativist appeal to his core supporters on immigration.

The caravan of refugees walking north from Central America toward the U.S.-Mexico border has given him an evocative image, one that has looped across cable news networks for days and suggests an immediate threat, although the caravan is still about 1,000 miles from the U.S. He has cast the crowd as containing Middle Easterners who are potential terrorists — later admitting there was “no proof” of that.

Not even the attempted pipe bomb attacks on his critics have diverted the president’s attention. On Thursday, his administration announced it was sending 800 troops to the border. On Friday, hours after the arrest of a Florida man who allegedly crafted the bombs, administration officials said Trump next week would announce plans to invoke emergency powers to stop migrants from entering the United States, casting them as a grave national security threat. The move extends Trump’s long-expressed desire to curb both illegal and legal immigration.

Recently, the White House began a daily call about the caravan, according to people familiar with it, featuring officials from both the administration and Congress. White House and Republican Party officials also are urging surrogates to go on TV and talk about the caravan.

Trump has made the migrant movements a standard part of his rally speeches. In a Friday night event in Charlotte, the president, as he typically does, cast migrants as threats to the nation and Democrats as their allies who favored “caravan after caravan” crossing the border.

“As we speak, the Democrat Party is openly encouraging caravan after caravan of illegal aliens to violate our laws and break into our country,” Trump said Wednesday night during a rally in Wisconsin.

He also claimed that unnamed American towns are being liberated from violent immigrants, and residents in those unnamed towns are gathering at their windows to applaud American immigration agents.

Thousands of Central American migrants arrived in southern Mexico on Oct. 21, on their journey to the United States.

“I’m telling you, it’s like — like watching World War II movies,” he said. “It’s like watching documentaries on World War I and World War II. The occupations, they get them, they take them out, and the people are on their windows, they’re clapping and screaming and they’re happy.”

His words echo previous thrusts before earlier elections. In the final days before the special U.S. Senate election in Alabama last December, Trump declared, “We’re going to have borders on top of borders.”

A few months later, before a special congressional election in Pennsylvania, he proclaimed, “The Democrats are the party of sanctuary cities . . . They like to protect criminals.”

He turned to immigration again in August in Ohio, when he campaigned for a Republican running in a special House election. “A vote for . . . the Democrats is a vote to let criminals and drugs pour into our country,” he said.

So far the president is fighting a one-sided battle. Most Democrats are choosing not to engage, keeping their focus instead on health care, an issue they believe is more important to voters.

The Democratic group American Bridge sent an attention-seeking email Thursday with the subject line “Kanye Traveling to the Caravan.” But the body of the email was about Republicans and preexisting health conditions.

“I have to be honest. As an immigration advocate I think most Democrats are being smart not getting ensnared in Trump’s frame and keeping true to the issue that’s kicking [it] in race after race,” said Frank Sharry, executive director of the pro-immigrant America’s Voice. “In the crude calculus of the homestretch politics, do you want to be debating Trump on a caravan 1,000 miles away, or 130 million Americans with preexisting conditions who might lose their protections?”

“You don’t need to get into a deep immigration policy debate at this point, two weeks before the midterms,” he added. “Trump just wants to demagogue the issue.”

Democrats and immigration advocates point to evidence of the limitations of Trump’s base appeal. Many of the candidates he campaigned for during previous elections lost. During the 2017 gubernatorial race in Virginia, Republican nominee Ed Gillespie also turned toward immigration in the final weeks of the campaign, attempting to tie MS-13 gang violence to Democratic nominee Ralph Northam’s vote against banning sanctuary cities.

“We were a little frustrated with him,” Sharry said of Northam. “’Why isn’t he standing up and talking about immigration, dammit?’ But he stood true to his ‘I’m a doctor who cares about health care and I’m going to stick to that and be boring as possible.’ ”

He won by 9 points.

Trump has told White House advisers that immigration is an issue on which Democrats have “no message on whatsoever,” in the words of one senior White House official.

“It’s a good message in there is a simple contrast,” said the senior official.

Republicans view the general immigration issue as one with potency across the country, which can motivate Trump supporters, particularly white men, and put fear into the minds of independents. They have run ads on sanctuary cities in Minnesota, Pennsylvania and California. In North Dakota, almost as far from the Mexican border as any other state, many of the Republican ads have been about sanctuary cities.

“This is a big factor,” said Matt Gorman, a spokesman for the National Republican Congressional Committee. “Immigration — even before the caravan — was an issue that was popping in districts for months, including ones not even near the border.”

In a national Washington Post-ABC News survey earlier this month, 16 percent of registered voters viewed immigration as one of the single most important issues in their vote; it trailed other issues such as the economy, health care and equal treatment of men and women.

Those surveyed gave Democrats in Congress an 11-point advantage over Trump on who they trust more to handle immigration. But Trump does better when it comes to border security. A Washington Post-Schar School poll in July found that Americans trusted Trump over Democrats in Congress by an 8-point margin when asked which was better at border security. His advantage grew to 17 points in congressional battleground districts, which lean more Republican.

“Border security is a real concern among voters, and the caravan elevates the issue at a pretty important point in time,” said Neil Newhouse, a Republican pollster. “And it has an impact because border security is already an issue in this election.”

Republicans believe the argument resonates most in border states, including competitive contests in Texas and Arizona.

In Indiana, Republican Mike Braun’s campaign repeatedly refers to Sen. Joe Donnelly (D-Ind.) as “Mexico Joe” — a reference to a family business that relies on Mexican labor — even when talking about health care, the economy or the Iran nuclear deal.

In Missouri, Republican candidate Josh Hawley has invoked the caravan as a way to paint Democratic Sen. Claire McCaskill as unwilling to enforce border controls.

“This is the kind of weakness that invites this chaos, it invites this national security crisis, really,” he said on Fox News. “That is what we cannot afford.”

Sen. Ted Cruz (R-Tex.) has gone a step further, joking that his Democratic opponent wants to be in charge of the caravan.

“There’s a caravan right now marching north,” Cruz told supporters Saturday. “I’m just waiting to see Beto O’Rourke come down and start leading the caravan.”

O’Rourke on Wednesday denounced that sort of “paranoia and fear,” saying that it was being spread just before the election by “an administration that’s trying to make us scared of one another.”

“Do you want to be motivated by fear, paranoia — or are we the big, bold, confident country that I know us to be?” he said.

In some blue and purple states, Democrats have used the president’s focus on the caravan to go on offense. On Tuesday night, at the final debate in Colorado’s race for governor, Democratic nominee Jared Polis took a question about the caravan as a chance to pivot to the Trump administration’s unpopular policy of separating immigrant families at the border.

“There is a national emergency, and it’s an emergency of character,” said Polis, a congressman from Boulder who had voted against the separation policy. “It’s an emergency when a 2-year-old child is ripped from their mother’s arms and sent thousands of miles away. It’s not who we are as a nation.”

Republican nominee Walker Stapleton, asked if caravan members would be “welcome” in Colorado, said they wouldn’t. But he said that he would not send the National Guard to the border if it meant separating families, and he signaled that he backed legal status for young immigrants brought to the United States by their parents.

“We have lived in the state of Colorado with the federal government’s failure to solve our immigration problems,” Stapleton said. “I don’t support separating families. I support ‘dreamers.’ I support those who contribute to the fabric of our state.”

Frank Luntz, a veteran Republican pollster who has run numerous focus groups with voters, said both parties misunderstand the nation’s sentiments: Democrats underestimate the public’s desire for enhanced border security, while Republicans underestimate its empathy for immigrants and their plight.

“I think the Republicans made a mistake by not focusing on the economy, frankly,” Luntz said. “It may not be as hot an issue but it has a greater impact on people’s day-to-day lives. I think that any distraction of the economic success of the last two years is not good for Republicans. And that includes immigration and that includes the caravan.”

David Weigel and Scott Clement contributed to this report.