MEXICO CITY — The caravan of Central Americans that has been making its way from Honduras toward the United States border moved on from Mexico City in the pre-dawn chill of Saturday, as migrants strapped on backpacks, rolled up blankets and hoisted sleeping children into their arms to begin the next leg of their journey.
For much of the past week, the giant capital, which prides itself on being a sanctuary for refugees, turned an athletic stadium into a camp for some 5,000 migrants and offered them every type of city service.
Ever since the caravan crossed into Mexico three weeks ago, the country has faced a reckoning over the way it treats Central American migrants. Contradictory impulses are in play.
In Mexico City this week, doctors and dentists were on hand for free checkups, and children spent the mornings drawing and coloring. A mariachi band played after breakfast, young men sparred with retired boxers and, this being Mexico, masked wrestlers turned up for a lunchtime bout.
It wasn’t always this way. For decades, successive administrations used strong enforcement measures to control Mexico’s borders. The migrants tried to travel out of the sight of authorities, putting them out of mind of most Mexicans.
Now, Mexico City’s embrace of the caravan has thrown an opposing idea into sharp relief, an acknowledgment that the country’s asylum laws require the government to protect migrants.
“There is a constant back and forth,” said Stephanie Leutert, who studies Central American migration at the Lyndon B. Johnson School of Public Affairs at the University of Texas at Austin. “We want to stop people — and we want to make sure they are safe,” she said, summarizing the tension in the Mexican government’s approach.
That ambivalence was on full display on Friday.
Local officials cleared the way for an advance group of the caravan to board empty metro trains at 6 a.m. that ran express to the edge of Mexico City. A few miles further on, police flagged down commuter buses to carry five or 10 migrants at a time to the next stop.
Traveling in stages, the migrants reached the city of Queretaro, 135 miles to the northwest, by evening. The state governor announced that 760 people had arrived and would spend the night in the city’s stadium to await the arrival of the rest of the group on Saturday.
The migrants’ goal is Tijuana, across the border from San Diego, a route that avoids the crime-scarred states of northeastern Mexico.
“We will try to create a chain of protection across the states,” said Nasheli Ramírez, the president of Mexico City’s human rights commission. She described the route and where responsibility would pass, one by one, to her counterparts in other states.
Such good will was missing, though, for another migrant caravan.
A few miles north of the Guatemalan border, federal police and immigration agents stopped a group of about 250 people — mostly men from El Salvador — and took them on buses to a migration detention center, Sergio Seis, a local migration official, said.
This group, it appeared, would not be given the same welcome that the first caravan — and two subsequent others now moving through southern Mexico — had received.
The conflicting approaches have played out as President Trump continued to hammer away at the idea that a caravan of people fleeing poverty, violence and political repression presented a threat to the security of the United States. On Friday he announced changes to policies that will limit migrants’ ability to seek asylum, a move targeted at the caravans.
But caravan members have paid little heed to Mr. Trump’s declarations. Many of the migrants are unlikely to qualify for asylum because they are seeking work, not refuge, in the United States.
“We have to fight, we have to give it a try,” said Agustín Ramírez, a sawmill worker from the Honduran town of Talanga. “God moves mountains.”
The migrants left Honduras a month ago in a caravan that swelled into the thousands as word spread and people — especially families — sought safety in numbers.
They arrived in a Mexico hanging in political limbo. The outgoing government of Enrique Peña Nieto is set to hand over power on Dec. 1 to a new leftist government. For years, first during the Obama administration and then after Mr. Trump took office, Mr. Peña Nieto’s government had been acting as a junior partner of the United States in blocking the migrants’ passage north.
President-elect Andrés Manuel López Obrador has promised a different approach.
He has pledged to grant temporary work visas to Central American migrants, declaring that nobody should be forced to migrate, and seems unlikely to stand in the way of those who choose to test their luck by traveling to the American border.
Mr. Trump has prioritized the detention of migrants over the new free trade agreement with Mexico and Canada, said Carlos Heredia, an economist who studies migration at CIDE, a Mexico City university. Mr. López Obrador’s response, he said, has been: “‘I will not do the United States’ dirty work.’”
“It is certain that there will be a clash between Washington and the López Obrador government,” Mr. Heredia said. “Whatever Mexico does, it will never be enough. Trump will keep raising the bar.”
As the migrants prepared to leave the camp in Mexico City, politics seemed far from their thoughts. They gathered around American lawyers who arrived at the stadium to explain the complexities of the asylum process in the United States.
“They don’t give a damn if you are poor,” Joseph Hutz, an immigration lawyer, told a small group. “They don’t give a damn if you are a good person.”
But Mr. Hutz knew that his warnings would get little traction. “We hear you and we’re going to keep going,” he said in an interview, summarizing the migrants’ response.
He argued that migrants would be better off seeking asylum in Mexico, but the option held little appeal for many.
Fewer than 50 people initiated asylum applications in Mexico City, according to Casa Refugiados, an organization that helped people at the stadium fill out forms.
Instead they prepared to push on, some just trying their luck, others certain they could never go back to the countries they left behind.
“They are killing everyone in El Salvador,” said Claudia García Sordo, 18, who is from the town of San Miguel. She has been in Mexico since the spring, fleeing a gang that wanted her to sell drugs. After she arrived, the gang killed her stepfather, her 2-year-old brother and her 16-year-old sister, she said.
“We’re not scared,” she said, betraying no emotion. “Fear is dead to us.”