Central Americans traveling together in a mass caravan smashed through a Guatemalan border fence on Friday and fled toward Mexican territory, directly defying President Trump’s threats and Mexican authorities' call for an organized migration.

The 4,000-person strong-migrant caravan pushing north toward the United States initially stalled Friday morning at Guatemala's border with Mexico, where members debated the next step.

On the Mexican side of a border bridge, they were met by a wall of police with riot shields. About 50 migrants succeeded in pushing through before officers unleashed pepper spray and the rest retreated. The chaos calmed somewhat as migrants formed lines stretching across the bridge and some even returned to the Guatemalan side to buy water and food.

But others, tired of waiting, jumped off the bridge into the Suchiate River. Migrants organized a rope brigade to ford its muddy waters, and some floated across on rafts operated by local residents who charged a dollar or two to make the crossing.

Manelich Castilla, the Mexican federal police chief, told Foro TV that his forces successfully prevented a violent breach by the migrants. But in a separate interview with Milenio television, he said people not part of the group had attacked police with rocks and fireworks.

"It will be under the conditions that have been said since the start," Castilla said. "Orderly, with established procedures, never through violence or force as a group of people attempted."

Earlier Friday, Mexico's ambassador to Guatemala said his country intended to enforce what he called a policy of orderly entry in the face of the thousands trying to cross.

Ambassador Luis Manuel Lopez Moreno added that more than 100 migrants had been allowed to cross the bridge to apply for refugee status, including some who were from the caravan and others who were not.

Trump has told Mexico that he is monitoring the country’s response. On Thursday he threatened to close the U.S. border if Mexico didn't stop the caravan. Later that day he tweeted a video of Mexican federal police deploying at the Guatemalan border and wrote: "Thank you Mexico, we look forward to working with you!"

Still, Mexican officials said those with passports and valid visas — a small portion of those trying to cross — would be let in immediately.

Migrants who want to apply for refuge in Mexico were welcome to do so, they said, but any who decide to cross illegally and are caught will be detained and deported.

The first members of the caravan began arriving in the Guatemalan border town of Tecun Uman on buses and trucks early Thursday, but the bulk of the group sloshed into town on foot in a downpour late in the afternoon and into the evening.

Fox News’ Barnini Chakraborty, Greg Norman and The Associated Press contributed to this report.