Trump tweeted that he wanted "Mexico to stop this onslaught." He also suggested that it could jeopardize a revamped trade deal with Mexico and Canada, which is waiting to be signed by each country's leader.
Trump did not detail his military threat. Earlier this year, some National Guard members were deployed to the border on a limited mission that does not include contact with migrants.
More than 2,000 Hondurans are in a migrant caravan trying to reach the United States. Mexico's government says migrants with proper documents can enter Mexico and those who don't either have to apply for refugee status or face deportation.
The immigration issue sparked a lively confrontation Thursday at the White House between chief of staff John Kelly and national security adviser John Bolton, according to news reports.
White House press secretary Sarah Huckabee Sanders said members of the administration were "not angry at one another" - that the Trump team is "passionate about solving the issue of illegal immigration."
She turned the table on Democrats, saying they have failed to help the administration address the growing immigration crisis.
"They should be ashamed for pushing an open borders agenda and are only doing this for strictly political reasons," she said in a statement.
On the new trade pact, some analysts don't think it's in any immediate danger. But trade attorney Daniel Ujczo of Dickinson Wright PLLC said there "is a significant concern" that Trump will hold the pact hostage "in any number of issues that will arise between the U.S. and Mexico as well as the U.S. and Canada.
Copyright 2018 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.