David Agren and Alan Gomez

USA TODAY

CIUDAD IXTEPEC, Mexico – From his home in Honduras, Yair Dubón paid close attention to the messages coming out of Mexico, where President Andrés Manuel López Obrador vowed he would not do the "dirty work" of the United States by cracking down on migrants passing through his country.

Such assurances gave Dubón, 38, a plumber, the push he needed to flee the gangs in his hometown and brave the journey through Mexico on his quest to reach the USA. After reaching a shelter in this city in southern Mexico, still more than 800 miles away from the U.S. border, he was unsure if he'd make it.

"It's really tough here," he said. "There are immigration checkpoints all along the highway. You can't trust anybody on the road."

Central American migrants such as Dubón are learning that the Mexican government has changed its approach to the rising number of migrants passing through the country, no longer welcoming and assisting them but arresting, detaining and turning back members of their caravans.

The humanitarian visas granted to migrants to live and work throughout Mexico have been cut off. The Mexican government ordered bus operators to stop ferrying migrants across the country. Police forces in several southern Mexican states blocked migrants from entering town centers.

Even citizens have stopped offering plates of food, water and bundles of used clothing, forcing migrants to scrounge for food, often picking mangoes that thrive in the tropical heat.

Mexico experts said the hastily arranged response is the result of López Obrador trying to establish his new government while juggling two competing forces: his campaign promise to regularize migration through his country in a compassionate way and the constant threats from President Donald Trump to seal the border and sanction Mexico.

"The Mexican government is between a rock and a hard place here," said Rachel Schmidtke, a program analyst for the Mexico Institute at the Washington-based, nonpartisan Wilson Center. "It’s a very delicate balance that they're striking where they’re trying to do more of a pragmatic immigration management strategy but at the same time not wanting to have conflicts with their neighbor to the north."

In April, Mexican immigration officials and federal police officers detained 371 migrants marching in a caravan. It was the largest raid against a caravan, a chaotic scene in which Mexican officials chased mothers, fathers and children into wooded areas off the road near Mapastepec in Chiapas state.

That harsh new reality for migrants in Mexico is a far cry from a few months ago. Under Mexico's previous president, Enrique Peña Nieto, Mexico introduced a scheme known as the "Plan Frontera Sur" – the Southern Border Plan – that stopped migrants from riding the rails northward and sharply increased the detentions of Central Americans.

López Obrador assumed power in December, promising a more humane approach.

The new president promoted development in Central America and southern Mexico "to make immigration optional, not necessary," he said last year in a letter to Trump. López Obrador pledged to protect the rights of migrants, who are often preyed upon by criminal gangs while transiting Mexico.

In January, Mexico started issuing one-year humanitarian visas to migrants arriving in Chiapas, which allowed them to work and cross the country without having to hire a smuggler.

"We heard those comments in Cuba, that (López Obrador) was going to help us," said Wilfredo Piñero, a Cuban who fled his communist island for Mexico. "But we got here, and it's not like that."

DNA testing:Homeland Security to use speedy DNA testing to verify migrant family relationships

Asylum seekers:Donald Trump wants to charge asylum seekers to process applications as migrants seek US entry

The crackdown begins

In January, the Mexican government decided to end the humanitarian visa program, saying it had been "too successful" and lured even more migrants from Central America.

Instead, National Immigration Institute Commissioner Tonatiuh Guillén announced April 23 that Mexico would issue regional visitor visas, which allow Central Americans to live and work in several southern states.

That change angered many migrants.

"This visa does nothing for me," said Marisela Guardado, 33, who fled her native El Salvador with her husband and three children after receiving death threats for being unable to make extortion payments to a gang.

Cari Reyes, a Honduran housed in a sweltering recreation center in the municipality of Mapastepec with hundreds of other migrants, said the government's sudden decision to change the visa rules has hurt.

"It's not right that they're playing with people's dignity," Reyes said. "We would like the president to keep his promise."

Keeping that promise would make it difficult for President López Obrador to stem the tide of migrants moving through his country, putting him back in Trump's crosshairs.

Trump zeroed in on migrant caravans last fall, when a large group started marching north from Honduras just as the U.S. midterm elections approached.

He railed against the caravan each day, issuing an escalating series of threats against Mexico and Central American governments if they didn't stop the flow of people through their countries.

Trump has threatened to seal off the entire southern border, vowed to cut off foreign aid to Mexico and declared that he would halt negotiations for a new trade deal between the United States, Canada and Mexico. He announced the United States would cut off $450 million in foreign aid to Central American governments.

Maureen Meyer, director for Mexico and migrant rights at the Washington Office on Latin America, a nonpartisan think tank, said those threats reverberated throughout Mexico, especially among its business leaders, because of the economic damage they could inflict on the country.

"That is different than the impact of having more wall, which at the end of the day, Mexico does not agree with but would not impact Mexico as a country," Meyer said. "It's certainly nothing compared to threats of closing one or two or all of the ports of entry. Those real, tangible and economic threats affect them way more."

'We would like to get to yes' Lawmakers signal growing concern on Trump’s Mexico-Canada trade deal

NRA:The NRA is embroiled in controversy. Can it recover in time to flex muscle in 2020?

Mexicans losing patience

Meyer said López Obrador has been freed to crack down on the caravans because so many Mexicans have soured on the plight of Central Americans coming in wave after wave of caravans.

"The administration (knows) they're not going to get that much pushback for enforcing immigration laws as much as they would have just a few months ago," she said.

That was clear this month as a caravan approached the town of Huixtla, about 50 miles from Mexico's southern border, a frequent crossing for migrants. Police cars circled the city, and loudspeakers warned residents to stay inside and close their businesses: "A violent caravan is coming."

Mayor José Luis Laparra said that previous caravan travelers were "peeing everywhere," that workers had to clean up the town square after each caravan and that crime increased with each passing wave.

"People got ... fed up," Laparra said.

In Mapastepec, locals expressed anger that López Obrador promised to create 80,000 jobs in the impoverished southern states of Mexico, then offered work visas to Central American migrants to take those jobs.

"Where are these jobs?" said Mario Santiago, owner of a small cafe. "There are a lot of unemployed people here."

Like what you're reading?:Download the USA TODAY app