MEXICO CITY (AP) — Thousands of exhausted migrants from the Central American caravan trudged along highways Monday toward Mexico City, where officials prepared a sports stadium to accommodate them as they try to reach the U.S. border still hundreds of miles away.

The first wave of more than 500 migrants spent Sunday night on concrete benches at the Jesus Martinez stadium, where they were served hot meals as authorities prepared to receive as many as 5,000 migrants from the lead caravan and several smaller ones hundreds of miles behind it. Nashieli Ramirez, ombudsman for the city's human rights commission, said the migrants would be able to stay at the stadium as long as necessary.

"We have the space in terms of humanitarian help," Ramirez said.

In a thundering voice vote late Sunday at a gymnasium in Cordoba, in the Gulf state of Veracruz, hundreds of the estimated 4,000 migrants in the lead caravan voted to strike out for the capital, eager to leave a part of the country that has long been treacherous for migrants trying to get to the United States. Cordoba is 178 miles (286 kilometers) from Mexico City by the shortest route, which would be the group's longest single-day journey yet since they began more than three weeks ago.

But the group encountered obstacles Monday. Truck after truck denied the migrants rides as they trudged miles along the highway, experiencing a taste of the colder weather of central Mexico. At a toll booth near Fortin, Veracruz, Rafael Leyva, an unemployed cobbler from Honduras, stood with a few hundred others for more than 45 minutes without finding a ride.

"People help more in Chiapas and Oaxaca," Leyva reflected, referring to the southern Mexican states the group had already traversed and where pickup trucks frequently stopped to offer rides.

Migrants were seen grouping in front of tractor trailers, forcing the big rigs to stop so that fellow migrants could climb aboard.

This impromptu ridesharing is precarious, with dozens scrambling onto vehicles at a time, and leaves some behind. And police will force the migrants off vehicles if the drivers complain.

Cesar Rodas, 24, had pushed a friend's wheelchair along with the caravan for 24 days across three countries. But he couldn't lift his friend and the chair onto a truck bed crammed with 150 migrants. Rodas was trying to get Sergio Cazares, a 40-year-old paraplegic from Honduras, to the U.S. for an operation that Cazares hopes will allow him to walk again.

Most of the weary caravan participants camped Sunday in Cordoba, a colonial city in the Veracruz sugar belt. But they were eager to divert toward Mexico City from Veracruz, a state where hundreds of migrants have disappeared in recent years, falling prey to kidnappers looking for ransom payments. They are still more than 600 miles from the U.S. border.

They hope to regroup in the Mexican capital, seeking medical care and rest while awaiting stragglers. The caravan has found strength in numbers as it meanders north, with townspeople coming out to offer food, water, fresh clothes and replacement footwear.

It is unclear what part of the U.S. border the caravan will aim for eventually, or how many may splinter off on their own. Several hundred have pushed ahead to the central city of Puebla, while more streamed into Mexico City on Monday. Some stopped at the Basilica of Our Lady of Guadalupe, a major pilgrimage site in the capital, to thank the Virgin Mary for watching over them during the voyage.

Many of the migrants said they remain convinced that traveling together is their best hope for reaching the U.S. The migrants generally say they are fleeing rampant poverty, gang violence and political instability primarily in the Central American countries of Honduras, Guatemala, El Salvador and Nicaragua.

Yuri Juarez, 42, said he thinks there's a "very low" chance he will get asylum in the United States. But he said he had no way to work back home in Villanueva, Guatemala, where he closed his internet cafe after gang members extorted him, then robbed his customers and finally stole his computers.

Mexico faces the unprecedented situation of having three migrant caravans stretched over 300 miles (500 kilometers) of highway in the states of Chiapas, Oaxaca and Veracruz. The largest group has been followed by about 1,000 who crossed over from Guatemala last week and a second group of about the same size that waded over the Suchiate River on Friday.

Mexico's Interior Ministry estimated over the weekend that there are more than 5,000 migrants in total currently moving through southern Mexico via the caravans or in smaller groups. The ministry said 2,793 migrants have applied for refugee status in Mexico in recent weeks and around 500 have asked for assistance to return to their home countries.

President Donald Trump has ordered U.S. troops to the Mexican border in response to the caravans, with more than 7,000 active duty troops earmarked to deploy to Texas, Arizona and California. Trump plans to sign an order that could lead to the large-scale detention of migrants crossing the southern border and bar anyone caught crossing illegally from claiming asylum.