President Donald Trump threatened to deploy the military and close the southern US border on Thursday if Mexico did not move to halt large groups of migrants headed for the United States from Central America.