A week out from the midterm elections, the Pentagon said Monday it is sending 5,200 troops, some armed, to the Southwest border this week in an extraordinary military operation to stop Central American migrants traveling north in two caravans that were still hundreds of miles from the U.S. The number of troops is more than double the 2,000 who are in Syria fighting the Islamic State group.

President Donald Trump, eager to focus voters on immigration in the lead-up to the elections, stepped up his warnings about the caravans, tweeting: "This is an invasion of our Country and our Military is waiting for you!"

@realDonaldTrump: Many Gang Members and some very bad people are mixed into the Caravan heading to our Southern Border. Please go back, you will not be admitted into the United States unless you go through the legal process. This is an invasion of our Country and our Military is waiting for you!

His warning came as the Pentagon began executing "Operation Faithful Patriot," described by the commander of U.S. Northern Command as an effort to help Customs and Border Protection stiffen defenses at and near legal entry points. Advanced helicopters will allow border protection agents to swoop down on migrants trying to cross illegally, he said.

"We're going to secure the border," Air Force Gen. Terrence O'Shaughnessy, the Northern Command leader, said at a news conference. He spoke alongside Kevin McAleenan, commissioner of Customs and Border Protection.

Eight hundred troops already are on their way to southern Texas, O'Shaughnessy said, and their numbers will top 5,200 by week's end. He said troops would focus first on Texas, followed by Arizona and then California.

The number of people in the first caravan has dwindled to 3,500 from about 7,000, though a second one was gaining steam and marred by violence. About 600 migrants in the second group tried to cross a bridge from Guatemala to Mexico en masse on Monday but were met by ranks of Mexican federal police who blocked them from entering. The riverbank standoff followed a more violent confrontation Sunday when the migrants used sticks and rocks against Mexico police. One migrant was killed Sunday night by a head wound, but the cause was unclear.

The first group passed through the spot via the river — wading or on rafts — and was advancing through southern Mexico. That group appeared to begin as a collection of about 160 who decided to band together in Honduras for protection against the gangs who prey on migrants traveling alone and snowballed as the group moved north. They are mostly from Honduras, where it started, as well as El Salvador and Guatemala.

Overall, they are poor, carrying the belongings that fit into a knapsack and fleeing gang violence or poverty. It's possible there are criminals mixed in, but Trump has not substantiated his claim that members of the MS-13 gang, in particular, are among them.

The president's dark description of the caravan belied the fact that any migrants who complete the long trek to the southern U.S. border already face major hurdles, both physical and bureaucratic, to being allowed into the United States. Migrants are entitled under both U.S. and international law to apply for asylum, but it may take a while to make a claim. There is already a bottleneck of asylum seekers at some U.S. border crossings, in some cases as long as five weeks.

McAleenan said the aim was to deter migrants from crossing illegally between ports, but he conceded his officers were overwhelmed by a surge of asylum seekers. He also said Mexico was prepared to offer asylum to the caravan.

"If you're already seeking asylum, you've been given a generous offer," he said of Mexico. "We want to work with Mexico to manage that flow."

The White House is also weighing additional border security measures, including blocking those traveling in the caravan from seeking legal asylum and preventing them from entering the U.S.

The military operation drew quick criticism.

"Sending active military forces to our southern border is not only a huge waste of taxpayer money, but an unnecessary course of action that will further terrorize and militarize our border communities," said Shaw Drake of the American Civil Liberties Union's border rights center at El Paso, Texas.

Military personnel are legally prohibited from engaging in immigration enforcement. The troops will include military police, combat engineers and others helping on the southern border.

The escalating rhetoric and expected deployments come as the president has been trying to turn the caravans into a key election issue just days before the midterm elections that will determine whether Republicans maintain control of Congress.

"This will be the election of the caravans, the Kavanaughs, law and order, tax cuts, and you know what else? It's going to be the election of common sense," Trump said at a rally in Illinois on Saturday night.

On Monday, he tweeted without providing evidence: "Many Gang Members and some very bad people are mixed into the Caravan heading to our Southern Border."

"Please go back," he urged them. "you will not be admitted into the United States unless you go through the legal process. This is an invasion of our Country and our Military is waiting for you!"

The troops are expected to perform a wide variety of functions such as transporting supplies for the Border Patrol, but not engage directly with migrants seeking to cross the border, officials said. One U.S. official said the troops will be sent initially to staging bases in California, Texas and Arizona while the CBP works out precisely where it wants the troops positioned. U.S. Transportation Command posted a video on its Facebook page Monday of a C-17 transport plane that it said was delivering Army equipment to the Southwest border in support of Operation Faithful Patriot.

The U.S. military has already begun delivering jersey barriers to the southern border in conjunction with the deployment plans.

WATCH: The economic costs of immigration detention