COLUMBIA, Mo. — President Trump, joined by many Republican candidates, is dramatically escalating his efforts to take advantage of racial divisions and cultural fears in the final days of the midterm campaign, part of an overt attempt to rally white supporters to the polls and preserve the GOP’s congressional majorities.

On Thursday, Trump ratcheted up the anti-immigrant rhetoric that has been the centerpiece of his midterm push by portraying a slow-moving migrant caravan, consisting mostly of families traveling on foot through Mexico, as a dangerous “invasion” and suggesting that if any migrants throw rocks they could be shot by the troops that he has deployed at the border. The president also vowed to take action next week to construct “massive tent cities” aimed at holding migrants indefinitely and making it more difficult for them to remain in the country.

“If you don’t want America to be overrun by masses of illegal aliens and giant caravans, you better vote Republican,” Trump said at a rally here Thursday evening.

The remarks capped weeks of incendiary rhetoric from Trump, and they come just five days after a gunman reportedly steeped in ­anti-Jewish conspiracy theories about the migrant caravan slaughtered 11 people at a Pittsburgh synagogue in what is believed to be the worst anti-Semitic attack in U.S. history.

Trump has repeatedly cast the migrants as “bad thugs” and criminals while asserting without evidence that the caravan contains “unknown Middle Easterners” — apparently meant to suggest there are terrorists mixed in with the families fleeing violence in Honduras and other Central American nations and seeking asylum in the United States. The president also said Wednesday that he “wouldn’t be surprised” if liberal donor George Soros had funded the migrant groups — echoing the conspiracy theory that is thought to have influenced the accused Pittsburgh shooter.

Trump questioned again at Thursday night’s rally whether it was really “just by accident” that the caravans were forming.

“Somebody was involved, not on our side of the ledger,” Trump told the crowd. “Somebody was involved, and then somebody else told him, ‘You made a big mistake.’ ”

He also called birthright citizenship a “crazy, lunatic policy,” warning that it could allow people such as “a dictator who we hate and who’s against us” to have a baby on American soil, and “congratulations, your son or daughter is now an American citizen.”

Many of Trump’s Republican acolytes, from Connecticut to California, have followed his lead in the use of inflammatory messages, including an ad branding a minority Democratic candidate as a national security threat and a mailer visually depicting a Jewish Democrat as a crazed person with a wad of money in his hand.

Trump and his supporters argue that the media and the president’s political opponents call racism or anti-Semitism where none exists as a way to demean him and divide Americans. At a campaign rally Wednesday night in Estero, Fla., Trump sought to link his supporters to the accusations.

“We have forcefully condemned hatred, bigotry, racism and prejudice in all of its ugly forms, but the media doesn’t want you to hear your story,” Trump said. “It’s not my story. It’s your story. And that’s why 33 percent of the people in this country believe the fake news is, in fact — and I hate to say this — in fact, the enemy of the people.”

Meanwhile, an online campaign video personally promoted by Trump this week was denounced by Democrats and some Republicans on Thursday as toxic or even racist.

The footage focuses on Luis Bracamontes, a twice-deported Mexican immigrant who was given a death sentence in April for killing two California law enforcement officers in 2014. The recording portrays him as the face of the current migrant caravan, when in fact he has been in prison for four years.

The 53-second video is filled with audible expletives and shows Bracamontes smiling as he declares, “I killed f------ cops.” With a shaved head, a mustache and long chin hair, Bracamontes shows no remorse for his crimes and vows, “I’m going to kill more cops soon.”

Trump shared the video Wednesday afternoon with his 55.5 million followers on Twitter, and it remained pinned atop his Twitter page the next day. As of late Thursday afternoon, the video had been viewed 3.5 million times.

Ohio Gov. John Kasich (R), a potential 2020 challenger to the president, said Trump crossed a new Rubicon by posting the video.

“We all go through periods where we’re in a tough race and we’ve got to figure out what we should do, but at some point there’s just an ethical line that you should not cross, and I think it’s been crossed here,” Kasich said in an interview. “This latest ad is an all-time low. It’s a terrible ad, it’s designed to frighten people and it’s wrong.”

Rep. Bennie Thompson (D-Miss.) sounded a similar note, saying in a statement Thursday that Trump and Republicans “are so desperate to distract voters from their failures on everything from health care to foreign policy, they have sunk to new lows with hateful rhetoric and racist campaign ads.”

Five days from Election Day, the video underscored the dilemma facing Democrats as they work to calibrate their response to the president’s increasingly incendiary language on race and immigration.

Democratic strategist Donna Brazile said leaders of her party have two schools of thought about Trump’s video and his caravan rhetoric in general. She said they fear that reacting to it only allows the president to dictate the terms of the debate and “spread the toxins into the bloodstream of the electorate,” but that the tone is so appalling — especially coming from the president himself — that they feel compelled to speak out.

“Trump has opened up a whole new playbook to sow discord and to weaponize hate,” Brazile said. “Everyone has seen low politics. We’ve all done low politics. But Lee Atwater would be shocked at the vitriol we’re seeing today — and, man, Lee was scrappy. This is virulent. It’s bone-chilling. It’s like a toxin.”

Atwater, who died in 1991, was a Republican consultant who was known for crafting culturally divisive messages.

Rep. David N. Cicilline (D-R.I.) described the video as a “horribly racist” attempt by Trump to “prey on people’s fears and lack of information about how the immigration system works.”

Some conservatives, meanwhile, cheered the president for ramping up his focus on an issue that helped push him to victory in 2016. “The clip of convicted cop murderer Luis Bracamontes laughing in a Calif. court is something every American should see,” Fox News host Laura Ingraham wrote in a tweet.

Republican strategists say Trump’s immigration push is helping the party here in Missouri, where state Attorney General Josh Hawley is trying to unseat Democratic Sen. Claire McCaskill. Race has been a sensitive issue in the state, which was rocked by unrest in 2014 after an unarmed 18-year-old African American man was fatally shot by a white police officer in Ferguson, Mo.

Ahead of his rally here Thursday in Columbia, the speakers blared “We Are The World,” Michael Jackson’s ode to peace and inclusiveness. Several white supporters interviewed at the event rejected the notion that the president is racially divisive — and they said they resented the very suggestion.

“He’s not a racist president and I’m not a racist,” said Meredith Leon, 65, a retired small-business owner from Columbia. “We want law and order and justice for all people. I’m fed up with everything being race, race, race. Fed up!”

David Ewing, 59, a farmer in Tebbetts, Mo., said he supports Trump’s immigration agenda “100 percent.”

“I don’t think he’s racist,” Ewing said. “It’s just the far left trying to do anything they can to stop him. I ignore them, really.”

As Trump has intensified his rhetoric, a growing number of Republican candidates across the country have followed suit. Some feature graphic anti-immigrant messages and images in their campaign ads, while others have been accused of inciting anti-Semitic or anti-Muslim sentiment.

In Tennessee, a recent ad for Republican Senate nominee Marsha Blackburn features footage of the caravan and warns that it includes “gang members, known criminals, people from the Middle East, possibly even terrorists.” The ad also slams Blackburn’s Democratic opponent, Phil Bredesen, for stating that the caravan is “not a threat to our security.”

An ad released Thursday by Pennsylvania Republican gubernatorial nominee Scott Wagner features ominous music along with footage of the caravan. “A dangerous caravan of illegals careens to the border, two more behind it, and liberal Tom Wolf is laying out the welcome mat,” the ad declares, referring to the state’s Democratic governor.

A Facebook ad being run by the campaign of Rep. Rob Woodall (R-Ga.) features a photo of three heavily tattooed Latino men with the message, “I will protect Georgia from violent criminal gangs.”

And in California, the campaign of Rep. Duncan D. Hunter (R-Calif.), who has been indicted on charges of alleged misuse of campaign funds, has called his opponent, Ammar Campa-Najjar, a “national security threat” with “close family connections” to Islamist militant groups. The 29-year-old Democrat’s grandfather, who died 16 years before he was born, was a key planner of the 1972 attack on Israeli athletes at the Munich Olympics. Campa-Najjar has condemned the attack.

“Instead of making an affirmative case for his own record, he’s trying to disparage the character of a fellow American,” Campa-Najjar said in an interview. “I think that speaks volumes about his policy record.”

The messaging has filtered down to local races as well. In Connecticut, a mailer recently sent out by Republican state Senate nominee Ed Charamut’s campaign depicts Democrat Matthew Lesser as holding a wad of money with a crazed look in his eyes. Lesser is Jewish, and the ad has been denounced for promoting anti-Semitic stereotypes.

After first defending the ad, Charamut’s campaign later issued an apology to Lesser, acknowledging that “the imagery could be interpreted as anti-Semitic.”

Some candidates who have long made inflammatory remarks on immigration and race have found themselves facing a backlash in recent days. Rep. Steve King ­(R-Iowa), who met in August with representatives of a far-right Austrian party and declared that “Western civilization is on the decline,” was publicly rebuked Tuesday by Rep. Steve Stivers (R-Ohio), the head of the National Republican Congressional Committee. King, who previously retweeted a self-described “Nazi sympathizer” and endorsed a Toronto mayoral candidate who appeared on a neo-Nazi podcast, has also seen companies such as Land O’Lakes withdraw their support for his campaign.

Trump’s rhetoric also has prompted outrage from a handful of lawmakers from his party, particularly those who are departing Congress or are in Democratic-leaning districts. Republican leadership has largely remained silent.

Sen. Jeff Flake (R-Ariz.), a frequent critic of Trump who is retiring at the end of his current term, said in a tweet Thursday that the ad featuring Bracamontes was “sickening” and that “Republicans everywhere should denounce it.”

Rep. Carlos Curbelo (R-Fla.), whose district was won by Hillary Clinton by 16 points in 2016, said on CNN that while he hadn’t seen the ad, it was “definitely part of a divide-and-conquer strategy that a lot of politicians, including the president, have used successfully in the past.”

“I hope this doesn’t work,” Curbelo said. “I hope that type of strategy starts failing in our country, but that’s up to the American people.”