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.