"I hope you're not going to let these people come through your country and march a thousand miles up through your country and come through our borders, because our laws are horrendous", Mr Trump said.
A federal police officer used a loudspeaker to address the masses, saying: "We need you to stop the aggression".
Edwin Santos of San Pedro Sula was one of the first to race past helpless Guatemalan police, clutching the hands of his father and wife. "We are not going to attend to the issue only with deportations or means of force".
Like Guatemala and Honduras, Mexico is a country of many migrants, raising the question of whether the political will exists for a confrontation.
In addition to making clear the current requirements for allowing migrants into Mexico, Moreno stressed "that there is no such thing as a transit visa for those wishing to cross Mexico to reach its northern border", according to a press release from the Mexican government.
US and Mexican officials have agreed on a plan to handle the Honduran migrant caravan - estimated to contain between 1,000 and 4,000 people - approaching the US-Mexico border.
"There is nothing there", Orellana said.
Elizabeth Oglesby, a professor at the University of Arizona's Center for Latin American Studies, said people join caravans like this because it's a way to make the journey in a relatively safe manner and avoid having to pay thousands of dollars to smugglers.
As the sun rose, a military helicopter flew along the Mexican side of the river foreshadowing the difficulties they could face. Late Thursday, some 300 Mexican federal police officers equipped with antiriot gear were deployed to the border crossing ahead of the caravan's expected arrival. "It's the third time that I'm trying to cross", said the 22-year-old who dreams of finding a construction job in Los Angeles.
The Mexico riot police pushed back and set off some smoke canisters.
Earlier in the week, the United States president had threatened to cut aid to Honduras and send USA troops to the Mexican border.
"It's a very hard situation for the Mexican government", says Ana Maria Salazar, a former Pentagon official who's now a security analyst in Mexico City.
Since the mid-1970s, migrants from Central and Southern America have exploited Mexico's relatively lax policies on border security to enter the USA illegally. "As of this moment I thank Mexico".
But it also openly attacked the governments of the Central America's nations most of the migrants are coming from, including Honduras and Guatemala.
On Thursday, Trump branded the migrant caravan an "onslaught" and an "assault on our country" in a series of typically fiery tweets.
US Secretary of State Mike Pompeo is meeting with leaders in Mexico City Friday, and the caravan is among the topics on the agenda.
"Mexico is in favor of legal, safe and orderly migration", he noted.
Still, the idea that Mexico could close its porous southern border - or that the United States would choke off the lucrative trade and other traffic between the two nations - strained the imagination.