More than 2,000 migrants on Saturday dropped their bid to reach the United States after Guatemala threatened to expel them out of concern they might spread Covid-19.
The group, mostly made up of Hondurans who set out last Thursday from San Pedro Sula, asked local authorities to help them return home, the Guatemalan president's office told news media.
An AFP journalist saw some being loaded into army trucks for the return trip.
But some small groups said they remained determined to reach the US to escape the poverty and violence in their home country.
Late Thursday, Guatemalan President Alejandro Giammattei had ordered the Hondurans detained and sent home. However, he urged them to return voluntarily.
"Amid the current health emergency, not only did they fail to respect measures to enter the country but also health measures established to protect our citizens," he said.
Guatemalan officials said some 3,000 people originally crossed the border without submitting to a Covid-19 test, required for foreigners entering the country. Many were not wearing masks.
Giammattei said that "a massive group of Hondurans violently broke in" to the country some 300 kilometers (190 miles) northeast of Guatemala City.
The caravan split up once in Guatemala, with a larger group taking a northern route toward Mexico and the smaller one following a southwesterly route.
- 'Shattered dreams' -
Mexico had deployed troops and immigration agents at border points to block the caravan.
"I am just so incredibly frustrated. Because we left home with a goal, which was getting to the United States. And when we see ourselves back home again -- our dreams have been shattered," migrant Blas Escobar told AFP.
"I am so angry because I came here, wasted time and the little money I had," added Eduardo Rodriguez, who injured his foot falling off a moving pick-up.
Both had tried to reach the border with Mexico through the department of Peten and had already traveled more than 250 kilometers on foot or in trucks.
In recent years, thousands of Central American migrants traveling in large groups have crossed into Mexico, with the aim of reaching the US border.
The caravan had set off just a month before the US presidential election, in which President Donald Trump -- whose hard line against migrants is a central plank of his policy platform -- is seeking a second term.
After Trump threatened Mexico with steep US tariffs if it failed to stem a surge of undocumented migrants, Mexican officials deployed some 26,000 troops to the country's borders.
Mexico's President Andres Manuel Lopez Obrador, a left-wing populist, has sought to maintain good relations with Trump despite the US leader's anti-Mexico rhetoric.