They arrived at dusk, dressed for combat, pouring from government vehicles.

A phalanx of military and police personnel swarmed a small hotel in the centre of Tapachula, a city near Mexico’s border with Guatemala.

Their target: unauthorised migrants.

Agents rushed door to door, hauling people away, while migrants shouted or ran out the back, scampering over the rooftops of neighbouring homes, witnesses said.

It was one of several raids here last week to sweep up migrants, part of a broad Mexican crackdown against the surge of Central Americans and others streaming towards the United States.

In recent weeks, the Mexican authorities have been breaking up migrant caravans and setting up round-the-clock roadblocks along common routes north.

Detentions and deportations in Mexico are quickly multiplying, sowing fear among the many thousands of Central Americans and others crowding the migrant shelters and budget hotels here in southern Mexico, most of them hoping to reach the US-Mexico border.

“So scary,” said one Cuban migrant at the hotel. “The fear never goes away.”

The Mexican government has been under intense pressure from President Donald Trump to block the tens of thousands of migrants trudging north each month.

With the US authorities unable to stop illegal immigration into the United States, President Trump has taken aim at countries in the region — including Guatemala, Honduras and El Salvador, the origins of most of the migration — threatening punishment unless they do more.

Last week, Mr Trump stunned officials and business leaders on both sides of the US border by promising tariffs on all Mexican imports unless Mexico stopped unauthorised migrants from crossing into the United States.

In Washington on Monday, Mexico’s foreign minister, Marcelo Ebrard, warned that the tariffs would simply undermine Mexico’s existing efforts to control migration.

“Tariffs could cause financial and economic instability,” weakening the Mexican government’s ability to solve the problem, Mr Ebrard said.

He and other officials are holding talks with the Trump administration this week to defuse the situation, but they warned that Mexico could respond with retaliatory measures

President Andrés Manuel López Obrador of Mexico insists that his country has been doing its part already, arguing that the crisis stems from a complex array of social and political problems across the region that would take billions in international investment — not punitive measures — to fix.

But their recent enforcement efforts aside, Mexican officials admit that their southern border is highly porous, with thousands of migrants slipping across every month through hundreds of known illegal crossings.

Trump compares US-Mexico border to Disneyland and calls end to family separations a disaster

Despite the pressure from Mr Trump, Mexican officials have insisted that they will not “militarise” their southern border by building a border wall or saturating it with security forces.

Analysts say Mexico does not have the resources to harden its 700-mile-long border with its Central American neighbours, especially since the nation is already stretched thin dealing with record levels of violence throughout the country.

And even if the Mexican government tried to fortify its southern border, analysts contend, it would probably not be enough to stop the unremitting surge.

In April, more than 109,000 people were apprehended at or near the southwest border of the United States, the highest monthly total since 2007.

Many were travelling in families, which have continued to arrive in historic numbers despite Mr Trump’s various efforts to stop the flow.

The mass migration was underway when López Obrador took office on 1 December.

But as a populist and lifelong champion of the poor, he campaigned on a platform of protecting migrants’ human rights, vowing to reject what he called the heavy-handed, enforcement-first approach of his predecessors.

At first, his administration opened its arms to migrants, broadcasting abundant work opportunities in Mexico and starting a program that gave expedited, year-long humanitarian visas to just about everyone who applied.

Officials also let the large and frequent migrant caravans entering from Central America to move relatively unimpeded across Mexican territory.

In the first four months of his administration, deportations fell 38 percent compared with the last four months of his predecessor’s term.

But the permissiveness encouraged more migration from Central America, with many seeking to use Mexico as a route to the United States.

In late March, Mr Trump threatened to close the border with Mexico to thwart migration. He also moved to cut off aid to the Central American countries sending most of the migrants to the United States.

Mexico appeared to respond quickly, with detentions and deportations jumping almost immediately.

Man shot at US-Mexico border

In April, nearly 15,000 migrants were deported by Mexico, up from about 9,100 in March, according to government statistics.

The monthly tally climbed even higher in May. Over the past two months, the López Obrador administration deported 67 percent more migrants than its predecessor did during the same period in 2018.

“The López Obrador administration clearly wants to create a different approach to managing migration that treats migrants more humanely,” said Andrew Selee, president of the Migration Policy Institute in Washington.

“But faced by the exponential growth in the flow and the pressure from the Trump administration to stop it, they have mostly fallen back on an enforcement-only approach, like previous Mexican administrations.”

The Mexican government has not entirely abandoned its efforts to accommodate migrants and absorb them into the nation’s fabric.

It has sought to expand eligibility for work and visitor visas for Central Americans.

And some migrants’ advocates say it has done a better job than past administrations of promoting its asylum program, which is on track to receive about 60,000 applications this year, about double the number last year.

Many thousands of migrants, often as a last resort to avoid deportation, have applied for visas or asylum in Mexico.

But the rush has overwhelmed the government’s migration agencies, which are crumpling under the weight of severe backlogs and budget cuts.

Despite the relentless increase in migration in recent months, the division that handles enforcement, the National Migration Institute, suffered a 23 percent reduction in its budget this year.

The delays are evident here in Tapachula, the main city in this part of Mexico and a major way station for migrants en route from Central America to the north.

Some have resorted to contracting smugglers.

Support free-thinking journalism and attend Independent events

In fact, the Mexican crackdown and Mr Trump’s efforts to restrict immigration have benefited the migrant-smuggling industry and the corrupt Mexican officials who abet it, analysts say.

López Obrador and officials in his delegation to Washington say they are optimistic about reaching a deal with the Trump administration.

The Mexican president suggested over the weekend that he was willing to “reinforce” the government’s migration-control strategies — as long as human rights were not violated.

But on Monday, Mexico’s ambassador to the United States, Martha Bárcena, said there was a limit to the Mexicans’ flexibility in the negotiations.

“And the limit is Mexican dignity,” she said.