MEXICO CITY — Mexican police, soldiers and National Guard are raiding hotels, buses and trains to round up migrants, creating scenes of weeping Central American mothers piled into police vans along with their children and overflowing detention centers with deplorable conditions.

Such scenes have caused an outcry in the U.S., but in Mexico there has been little backlash against the government of President Andres Manuel Lopez Obrador even though his country has historically had a deep sympathy for the plight of migrants.

This sympathy has been eroded by the migrant caravans of late 2018 and early 2019, which left a bad taste in the mouths of Mexicans and caused deep divisions among pro-migrant groups. Lopez Obrador’s reputation as a popular leftist has also muted the response to the crackdown. Add to this the disruption caused by migrants in Mexican border cities and threats of border closures or tariffs from President Donald Trump, and it has all led many Mexicans to see the waves of migrants as a problem.

Polls say Lopez Obrador’s approval rating has held steady at 66% to 72% despite the crackdown and reports of brutal conditions at the huge Siglo XXI migrant holding facility on Mexico’s southern border and other centers.

When the first caravan got a warm welcome in October, Mexicans were almost evenly split on whether Mexico should stop migrants from other countries from entering without proper documents, according to an El Universal survey which polled 1,000 people June 3-7 with a margin of error of 3.5 percentage points.

Eight months later, 61.5% supported stopping them and only 33% opposed it, according to the same poll. Even more dramatic was the reversal on giving migrants asylum in Mexico. In October, nearly 48% favored it, while 38% opposed. By June that had flipped, with 57% opposed and 37% favoring.

Even for Mexicans who don’t think Central Americans take jobs from Mexicans or cause increased crime — accusations routinely heard, especially in southern Mexico — there is a sense that too many migrants have come.

“The truth is that it is a problem for everyone. It’s better that they be sent back to their countries,” said Jorge Parada Leon, a Mexico City message delivery worker. “Crossing Mexico the way they do is dangerous, a lot of them have died. They should fix the problems they have in their home countries.”

Some have criticized the crackdown. The head of Mexico’s National Immigration Institute, Tonatiuh Guillen, resigned when the crackdown was announced in June to head off Trump’s threat of tariffs on Mexican products.

Porfirio Munoz Ledo, the congressional leader of Lopez Obrador’s Morena party, said that “it is morally unacceptable that on one hand we demand they (the U.S.) open the doors for us, but we close them in the faces of Central Americans, in order to do the United States’ dirty work.”

Lopez Obrador acknowledges the crackdown was implemented to avoid U.S. tariffs threatened by Trump in late May.

“A few days ago we were able to overcome a possible economic and political crisis, by means of an immigration agreement that requires us to be stricter in enforcing immigration laws,” he said. “We have established a relationship of respect and friendship with the people and government of the United States and this has allowed us to avoid confrontation that wouldn’t benefit anyone.”

Even some of the most outspoken defenders of migrants are defending Lopez Obrador’s crackdown on the porous southern border, where migrants from across the world simply wade or ride rafts across rivers marking the border.

The Rev. Alejandro Solalinde, who runs a shelter for migrants in the southern Mexico and has fiercely criticized past administrations, said that “someone had to impose order on the border everyone was crossing there without the slightest problem.”

Solalinde blamed a series of four or five immigrant caravans that brought thousands in 2018 and early 2019 that overwhelmed border cities and wore out an initially warm welcome.

“They were irresponsible in bringing migrants to the northern border and exposing them to risks in such a brutal way. They herded the migrants up to the border and caused a big international problem between the two countries,” he said.