The Pentagon is responding to President Donald Trump's claim of a 'National Emergency' at the border and is preparing to dispatch 800 military members to the southern border to confront a caravan of migrants.

Defense Secretary Jim Mattis is expected to sign an order as early as Thursday deploying the troops to support the Border Patrol on the U.S.-Mexico border, a U.S. official said.

The move come hours after the president cited a Fox News report and vowed 'I am bringing out the military,' as a caravan of several thousand migrants from Central America makes its way through Mexico toward the U.S.

Trump wrote on Twitter: '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.'

'MUST BE CHANDED [sic],' he added, misspelling 'changed,' and adding: 'but I am bringing out the military for this National Emergency. They will be stopped!'

Defense Secretary Jim Mattis is expected to sign an order as early as Thursday sending 800 or more troops to the southern border after calls by President Trump to protect against a caravan of potential migrants

Presidents have sent military members to the border before, but it is an idea that has met resistance from military brass.

The number of Border Patrol members hit 20,000 in 2016.

The caravan members are proceeding on foot and are weeks away from the border.

Honduran migrants, taking part in a caravan heading to the US, rest during a stop in Mapastepec, Chiapas state, Mexico, on October 24, 2018. - Thousands of mainly Honduran migrants heading to the United States, a caravan President Donald Trump has called an "assault on our country", continued their march to the US after one-day rest in Huixtla, Chiapas state in Mexico

US Defence Secretary Jim Mattis could authorize the deployment as soon as Thursday

It wasn't immediately clear whether the forces would be active duty troops or federalized National Guard.

They won't engage in lethal operations, CNN reported, but would instead work on fencing, technical support and wall materials on the border.

The U.S. official was not authorized to speak publicly because not all details of the military arrangement had been worked out, and so spoke on condition of anonymity.

The move to send the troops comes after a report that the migrant caravan has shrunk after 500 people voluntarily accepted bus trips back to their home countries.

Mexican authorities said many of those who decided to abandon the caravan and accept bus trips back home were 'sick or exhausted'.

A number of them were mothers with young children. There had previously been reports from the ground of parents pushing strollers or carrying children on their backs.

A small group of Honduran migrants trying to reach the U.S. border walk along train tracks in Trancas Viejas, Veracruz state, Wednesday, Oct. 24, 2018. As a caravan of thousands of Central Americans renewed their slow march toward the U.S. on Wednesday, others chose to travel in smaller groups following routes well-worn by decades of migrants fleeing poverty and violence.(AP Photo/Rebecca Blackwell)

The caravan members are traveling on foot, and are estimated to be weeks away from the border

Honduran migrants walking and aboard trucks head in a caravan to the US, in Huixtla on their way to Mapastepec Chiapas state, Mexico, on October 24, 2018. - Thousands of mainly Honduran migrants heading to the United States, a caravan President Donald Trump has called an "assault on our country", continued their march to the US after one-day rest in Huixtla, Chiapas state in Mexico

Trump has raised the issue of the caravan and vowed to send the military during his campaign rallies, with control of Congress up for grabs

With the caravan approaching and the midterm elections weeks away, Trump tweeted about stopping it last week and raised it repeatedly at his campaign rallies.

"I must, in the strongest of terms, ask Mexico to stop this onslaught — and if unable to do so I will call up the U.S. Military and CLOSE OUR SOUTHERN BORDER!" Trump tweeted.

The additional troops are to provide what one official described as logistical support to the Border Patrol. This would include a variety of things such as vehicles, tents and equipment, and perhaps medical support. It was not immediately clear how many, if any, of the extra troops would be armed. Because they would not be performing law enforcement duties they would not be in violation of the Posse Comitatus Act, which prohibits the federal government from using the armed forces in a domestic police role.

There already are about 2,000 National Guard troops assisting at the border under a previous Pentagon arrangement.