Trump Sending 5,200 Troops to the Border in an Election-Season Response to Migrants.

WASHINGTON — More than 5,000 active-duty military troops will deploy to the southern border by the end of this week, Defense Department officials said on Monday, an escalation of a midterm election show of force against a caravan of Central American migrants that President Trump has characterized as an “invasion of our country.”

The massing of American troops comes as Mr. Trump has seized on the caravan as a closing political message in the final week before the midterms, warning darkly — and without evidence — that “Middle Eastern” people are part of a dangerous mob of migrants threatening to surge into communities here.

But the caravan, which has shrunk from 7,000 people to less than 3,500, is still weeks away from reaching the United States. The rare use of the active-duty military to bolster Mr. Trump’s campaign message has intensified criticism that the president is using the military for political gain.

“This is using the troops as props,” said Jason Dempsey, who served as an Army infantry officer in Iraq and Afghanistan and is now an adjunct senior fellow at the Center for a New American Security. “We’re using a bunch of people to waste their time while they backstop the Border Patrol.”

The military buildup is the culmination of Mr. Trump’s efforts in recent weeks to appeal to his most fervent supporters and to focus the nation’s attention on the migrant caravan.

In an interview on Fox News late Monday, Mr. Trump said the caravan amounted to an invasion by “a lot of bad people” and gang members, and said the migrants are wasting their time because the troops will block their entry.

The president said his administration will build “tent cities” to indefinitely hold any migrants who try to seek asylum in the United States, in apparent defiance of court orders that prohibit long-term detention of children or families.

“We are going to put tents up all over the place,” Mr. Trump said during an interview on Monday night on “The Ingraham Angle.”

“We are not going to build structures and spend all of this, hundreds of millions of dollars,” he said. “We are going to have tents. They are going to be very nice, and if they don’t get asylum, they get out.”

Mr. Trump has repeatedly cited reports on Fox News as evidence of the gathering threat, though even some commentators on Mr. Trump’s favorite television network have called into question the need for such an aggressive military response to the caravan.

“Tomorrow is one week before the election, which is what this is all about,” Shepard Smith, a Fox News anchor, said Monday on his show. “There is no invasion. No one is coming to get you. There is nothing at all to worry about.”

He added: “We’re America. We can handle it.”

Kevin Appleby, of the Center for Migration Studies, criticized Mr. Trump’s decision to send troops, saying it shows weakness instead of strength.

“The president’s deployment of the world’s strongest military against a band of vulnerable asylum seekers is embarrassing,” Mr. Appleby said.

But the president’s comments on Monday and the troop announcement made it clear that the White House would not be deterred from focusing on the caravan, even after the suspect in the killing of 11 Jews in Pittsburgh accused Jews of orchestrating the caravan to bring in “invaders” who would kill his people.

Sarah Huckabee Sanders, the White House press secretary, angrily rejected on Monday any link between the president’s messaging about the caravan and the killings on Saturday at the Tree of Life synagogue in Squirrel Hill, a community in Pittsburgh.

“The very first thing that the president did was condemn these heinous acts,” she said. “The very first thing the media did was blame the president.”

Mr. Trump has been considering options for several weeks, and is soon expected to take executive action to bar entry to Central Americans, including for those seeking asylum. The active-duty military units will join Border Patrol agents and National Guard troops that are already gathered along the border in Texas, Arizona and California.

Military and border officials said that an initial group of 800 soldiers is already heading to Texas from Fort Campbell and Fort Knox as part of what the Pentagon is calling Operation Faithful Patriot. Gen. Terrence J. O’Shaughnessy, the commander of the United States Northern Command, said those soldiers will be joined by several thousand more in an bid to harden the border.

“The president has made it clear that border security is national security,” General O’Shaughnessy said.

If the caravan follows the pattern of previous groups of migrants, it is likely to shrink even more substantially in the weeks ahead, leaving it dwarfed by the gathering of armed soldiers.

Military and border officials insisted on Monday that they view the caravan as a serious threat, and that there were signs that more migrant groups were forming.

“We’ve got to be prepared for the potential arrival of a very large group,” said Kevin K. McAleenan, the commissioner of Customs and Border Protection. “We will not allow a large group to enter the United States in an unsafe and unlawful manner.”

Mr. McAleenan described a surge in Border Patrol resources in recent days, with more than 1,000 extra agents flowing to the area, including those with tactical experience in countering riots. He said the Border Patrol has deployed Black Hawk helicopters and other equipment to respond quickly to the arrival of the migrants.

But he said the active-duty military is being deployed because the Border Patrol agents, supported by about 2,000 National Guard troops, might not be enough to repel the men, women and children marching toward the United States.

Once fully deployed, the active-duty troops will include engineers who can help erect physical barriers to hold back the migrants, officials said. There will also be helicopter and plane units to transport Border Patrol agents, medical support personnel and planning teams that will help coordinate the influx of forces.

General O’Shaughnessy said the new forces will be armed and will operate under the same legal authorities as the National Guard troops already on the border.

The Mexican-American war in the mid-1800s sent huge numbers of troops to the border, and the military maintained a presence there for decades. For more than 60 years, the United States military maintained outposts along the long border with Mexico, according to a military history of the border published by the Combat Studies Institute Press at Fort Leavenworth.

Mr. Trump’s decision to send military forces to the border is a rare use of the armed forces in the past four decades. In the late 1980s, the Defense Department sent active-duty military and reserve troops to the border as part of an effort to counter the flow of illegal drugs from Mexico. The military provided similar support services during that mission.

Since then, Mr. Trump’s predecessors have largely relied on southern governors to call out the National Guard in response to increases in the flow of immigrants, guns and drugs from Mexico into the United States.

Mr. Trump is poised to shatter that tradition by fully embracing the power of the military as both a show-of-force deterrence and a real-world amplification of the Border Patrol agents who already seek to prevent illegal immigration.

In a tweet last week — one of several in which he has embraced the military’s power — Mr. Trump blamed Democrats for failing to support tougher border laws. He vowed to use his power as commander in chief to respond to what he considers a grave threat to the United States.

“Brandon Judd of the National Border Patrol Council is right when he says on @foxandfriends that the Democrat inspired laws make it tough for us to stop people at the Border,” the president wrote.

In the meantime, he added: “I am bringing out the military for this National Emergency. They will be stopped!”

Julie Hirschfeld Davis contributed reporting.