President Donald Trump threatened to deploy the military and close the southern U.S. border on Thursday if Mexico did not move to halt large groups of migrants headed for the United States from Guatemala, Honduras and El Salvador.

"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 wrote on Twitter.

Donald Trump tweet 1

Donald Trump tweet 2

Donald Trump tweet 3

Trump threatened to withhold aid to the region as a caravan with several thousand Honduran migrants traveled this week through Guatemala to Mexico in hopes of crossing into the United States to escape violence and poverty in Central America.

Trump's threat came as U.S. Secretary of State Mike Pompeo prepared to travel later in the day to Panama and then Mexico City, where he was to meet with Mexican President Enrique Peña Nieto on Friday.

Mexico's foreign ministry did not immediately respond to a request for comment.

Trump, who has sought to curtail immigration and build a border wall on the Mexican border, this week threatened to halt aid if Central American governments did not act.

Frustrated by Congress' failure to fully fund his proposed wall at the border with Mexico, Trump in April ordered National Guard personnel to help the Department of Homeland Security secure the border in four southwestern U.S. states.