Crime in American cities. The national opioid crisis. Election integrity. And now a terror attack considered the deadliest day for Jews in Israel’s 75-year history.

Not long after Hamas terrorists killed and kidnapped hundreds of Israelis this month, a wave of Republicans — on the presidential campaign trail, in state and congressional races and in the far-right corners of conservative media — reached for a familiar playbook: tying the issue to the nation’s southern border.

“What happened to Israel could happen to America because our country has been invaded by millions of people from over 160 different countries,” Representative Marjorie Taylor Greene of Georgia said on Fox News more than 24 hours after the attack.

“We know that there’s an open border, and I know that the biggest national security threat is if those terrorists come into America, and we have another 9/11,” Nikki Haley, a former United Nations ambassador under former President Donald J. Trump, told reporters last week in Concord, N.H.

“You cannot forget that the same people that attacked Israel are right now pouring at levels that nobody can believe into our beautiful U.S.A. through our totally open border,” Mr. Trump said on Monday, a baseless claim that was met with applause at a campaign event in Clive, Iowa, a Des Moines suburb.

While Republicans are otherwise reckoning with deep divisions, the remarkable unity on this front underscores the degree to which the 2,000-mile dividing line between the United States and Mexico remains a potent political symbol for the party. Since Mr. Trump paved his way to power on a nativist and hard-line approach to immigration, Republicans have invoked fortifying the border to address nearly every issue, in increasingly militant terms and often exaggerating the facts.

There are some indications that message is resonating. A national NBC News poll taken in September suggests that voters overwhelming trust Republicans over Democrats when it comes to handling the economy and crime — as well as immigration — heading into the 2024 election.

Alex Conant, a Republican strategist and a former adviser to Senator Marco Rubio, said the aggressive turns toward the border could be particularly effective now as the Biden administration grapples with two very real humanitarian crises: record numbers of migrants trying to cross the border and a fight against fentanyl that has become an urgent public health problem.

“The border is something that concerns a majority of Americans, especially when you can tie it to problems they see in their own neighborhoods,” he said.

Homeland Security officials have said they have found no specific or credible threat to the United States tied to Hamas. Andrew Bates, a White House spokesman, responded to Republicans in part by saying there is “strict national security vetting to determine whether individuals coming from anywhere in the world have ties to terrorist organizations.” Immigration experts said that the government cannot screen people who enter undetected but that the large numbers of migrants turning themselves in at the border are subjected to screening processes.

Since the southern border was drawn, American politicians have sought to wring political advantage by tapping into xenophobic fears, at times aimed at Chinese laborers, or young German men believed to be spies, or Jews and Catholics, historians and political analysts said.

Guadalupe Correa-Cabrera, a government professor at George Mason University in Virginia and who tracked the rise of the Mexican criminal organization Los Zetas, said the latest Republican rhetoric took cues from three distinct moments in U.S. history: the migration of Mexican laborers who became the economic engine of the Southwest, the government’s war on drugs that began in the 1970s, and the 9/11 terror attack and the so-called war on terror. All resulted in an increased military presence at the border, the building of physical barriers and an expansion of the U.S. deportation system.

Ms. Correa-Cabrera said that, much like now, those earliest border enforcement measures were mostly based on political arguments, not data that migrants increased crime or posed a greater threat to public safety. Many studies have shown this is not the case.

“It had to do with prejudice,” she said.

Attempts by politicians to link Mideast terror groups and Mexican criminal organizations have at times gained traction over the past two decades, but no substantial evidence has surfaced to support the claim, counterterrorism and insurgency experts said. The two kinds of groups have vastly different objectives and operate in cultural and economic borderland regions that do not share remotely similar dynamics.

With apprehensions at the southern border up overall, U.S. officials this year have recorded an increase in apprehensions of people whose identities match those on the F.B.I. terrorist watch list — 160 migrants in the 2023 fiscal year as of July, up from 100 the fiscal year before, according to the Department of Homeland Security. Such rolls constitute a small fraction of the millions of people seeking to cross the southern border and do not significantly measure the terror threat against the United States, terrorism and insurgency experts said. The uptick may be owing in part to the broad nature of the lists, they added, ensnaring people wanted for terrorist activities against their home countries but not aimed at the United States, as well as relatives or associates not accused of wrongdoing.

Although experts do not completely rule out the threat of a terror attack launched from the southern border, they described it as unlikely.

If Mideast terror organizations ever did plan an attack, “the northern border may even be more vulnerable,” said Bruce Hoffman, professor and director of the Center for Jewish Civilization at Georgetown University who specializes in terrorism studies. And such a plot would not necessarily be connected to illegal immigration, he added.

The 9/11 hijackers entered the United States on tourist, business and student visas. The last man to physically cross the border with materials for an explosive — Ahmed Ressam — was arrested in 1999 after he came in from Canada.

Still, the southern border remains a powerful symbol, for politicians and voters. When Mr. Trump adopted his “America First” slogan during his 2016 presidential campaign, he used it to harness grievance, xenophobia and fears about threats from abroad, economic competition from China on trade, and the potential economic and social consequences of increases in new immigrants.

On Monday, Mr. Trump, under fire for his criticism of Israel and for calling Hezbollah, the Iran-backed terrorist organization, “very smart,” invoked the deadly Hamas attacks on the Jewish state to stoke fears of terrorism at home. Returning to some of his most inflammatory themes on illegal immigration, he also took aim at legal pathways by pledging to reinstitute the travel ban from Muslim-majority countries and expand the freeze on refugees he enacted during his presidency.

“We aren’t bringing anyone from Gaza,” he said at his rally in Clive.

Mr. Trump is not alone. Republican candidates like Gov. Ron DeSantis of Florida often steer conversations with voters back to immigration. At a town hall in Iowa in August, when he was asked two questions in quick succession on unrelated issues, Mr. DeSantis managed to hit on the border. On the issue of eminent domain, he said he would support it “for the border wall down south.” Asked about the war in Ukraine, he said that as president, his “first obligation” would be “to protect the American people and to protect our border.”

In mailers, television ads and remarks, Republicans in state and congressional races regularly fault border enforcement. They cast blame on Mexican criminal organizations and undocumented immigrants for the fentanyl crisis — but not the American pharmaceutical companies that fueled the legal market for the drugs or the U.S. citizens who law enforcement officials say typically bring the harder narcotics across the border. They have claimed without basis that unauthorized immigrants are gaining access to the ballot box, while claims that widespread numbers of undocumented immigrants are voting have been consistently discredited.

Historians and political analysts warned that much of the heated language on immigration plays into far right and sometimes explicitly racist tropes that fuel fear with the potential for violence.

Two white supremacist shooting suspects in the last five years, Robert Bowers in Pittsburgh and Patrick Crusius in El Paso, Texas, cited “invaders” and a “Hispanic invasion” in the lead-up to their crimes.

On Saturday, the authorities in suburban Chicago said, Joseph Czuba, 71, fatally stabbed a 6-year-old boy and seriously wounded the child’s mother because of their Palestinian background. Officials tied the attack to what Mr. Czuba was hearing on conservative talk radio about the fighting overseas.

Nicholas Nehamas and Eileen Sullivan contributed to this report.