President Donald Trump threatened to deploy the military to close the U.S.-Mexico border on Thursday as a group of thousands of migrants trekked toward the border from Honduras.

Several thousand migrants journeyed from Honduras to Guatemala this week, headed for Mexico and on to the United States in hopes of escaping poverty and violence in Central America. As the caravan strung out from Guatemala City to the border, it was unclear whether those who made it the farthest would wait for their countrymen to arrive to attempt a mass crossing into Mexico.

Trump on Thursday demanded in a series of tweets that Mexican officials “stop this onslaught” before it reaches the U.S., adding that, “if unable to do so I will call up the U.S. military and CLOSE OUR SOUTHERN BORDER!”

The president said the issue is more pressing to him than the recently announced trade deal with Mexico and Canada that’s meant to replace the North American Free Trade Agreement.

“The assault on our country at our Southern Border, including the Criminal elements and DRUGS pouring in, is far more important to me, as President, than Trade or the USMCA,” the president wrote.

Mexican officials say the Hondurans won’t be allowed to enter as a group, and would either have to show a passport and visa — something few apparently have — or apply individually for refugee status, a process that can mean waiting for up to 90 days for approval.

Mexico’s ambassador to Guatemala, Luis Manuel Lopez Moreno, met with leaders of the caravan Wednesday and warned them that Hondurans caught without papers in Mexico would be deported.

Immigration along the southern border has sharply increased in recent months after the Trump Administration was forced to walk back a policy that separated migrant families at the border. According to The Washington Post, Border Patrol agents arrested more than 16,600 family members last month, an 80 percent increase from arrests in July.

Trump's tweets came one day before a scheduled meeting between U.S. Secretary of State Mike Pompeo and Mexican President Enrique Pena Nieto, according to Reuters.

The Associated Press contributed to this report.