ALBERTO opens his wallet to show how little is in it. It contains no money and no bank card, only the identity card issued by the government of El Salvador, from which he has just fled. He left his job as a car repairman in San Salvador, the capital, which paid $100 a month, because members of the MS-13 gang had demanded from him more money than he could afford. “They killed my brother. And my son,” he says. Alberto and his wife, Gabriela, who is four months pregnant, have found refuge, at least for now, in Tapachula, in the Mexican border state of Chiapas.

Central Americans sneak past Mexico’s immigration controls an estimated half-million times a year, many in search of security or better wages. A few years ago Alberto and Gabriela might have headed to the United States, but they hope to stay in Mexico as refugees. Applying for asylum is not easy. A decision can take up to 100 working days. During that time, the family must visit a government office in Tapachula once a week. Although the couple are entitled to work in theory, in practice many migrants stay jobless while they await an answer. Alberto and Gabriela plan eventually to head north, to a Mexican state with better job prospects than Chiapas.

Why not move on to the United States? Because of President Donald Trump, Alberto says. He and his wife know that the American government has separated hundreds of children from their parents at the border (though not that it suspended the policy after a public outcry). In June Jeff Sessions, the United States’ attorney-general, said migrants could no longer claim asylum on the grounds of gang violence or domestic abuse. That is likely to reduce sharply approvals of asylum claims by Central Americans. News of that decision will eventually reach the refugees on Mexico’s southern border.

Data on apprehensions of migrants by the United States suggest that Mr Trump’s harsh rhetoric on immigration during his first year in office has so far been a bigger deterrent than the brutal policies of his second year (see chart). Mr Trump has lamented that Central Americans were flowing “like water” into Mexico, which was doing “very little, if not nothing” to stop them. But the mood among the migrants in Tapachula suggests that at least some are reconsidering plans to enter the United States, if not to leave their home countries.

Less beastly

This is happening just as Andrés Manuel López Obrador, Mexico’s left-wing president-elect, prepares to take office in December. He hopes to co-operate with Mr Trump on migration, but the American president looks like a reluctant partner. If the United States succeeds in hardening its border, Mexico may struggle to cope with the flows across its southern one.

The United States has long pressed Mexico to strengthen that frontier. The “Southern Border Programme”, funded partly with American money, does not so much put up barriers as round up people who have got through. Migrants in Tapachula say that crossing the border from Guatemala is easy. But from 2013 to 2015 the number of Central Americans deported from Mexico doubled to 180,000 a year. Checkpoints line the roads from Tapachula. The “Beast”, a railway on which stowaways risk rape, robbery and murder as they head north, has become harder to board. Its speed has been increased and fences have been put up in railway yards.

At the same time, Mexico is letting more migrants stay. The number of asylum claims in Mexico has jumped from 1,300 in 2013 to 14,600 last year. Most applicants are Central Americans. The United States gets many more claimants: 108,000 Central Americans applied last year. But whereas the United States turns down three-quarters of claims from the countries of the “northern triangle” (El Salvador, Guatemala and Honduras), Mexico last year approved two-thirds of them. Awareness is spreading among migrants that asylum in Mexico is an option.

That does not mean they are welcome. New arrivals in Tapachula can get three nights’ accommodation in church-run shelters, but then must move on to make room for others, perhaps to a patch of floor without a blanket. That costs 100-250 pesos ($5-13) a night. The poorest sleep rough.

Relations with Mexicans in the area are rocky. Tapachula has the second-highest crime rate in Chiapas, even though there is hardly any organised crime in the city. Residents blame the migrants. Classrooms overflow with migrant children. Few locals feel kinship with the Central Americans, despite ties of history and geography. In 1823 Chiapas voted in a referendum to join newly independent Mexico rather than the United Provinces of Central America, a short-lived federation of Guatemala and four other countries.

Most migrants are eager to move on, but are unsure where their journey will end. A programme run by the UN High Commissioner for Refugees (UNHCR) provides a humane model. It moves migrants from Tapachula, where jobs are scarce, to Saltillo, a town in Coahuila near the American border, which has a labour shortage. Working with factory owners, UNHCR gives the refugees a two-week integration course, then leaves them to their own devices. Five-sixths of them remain in Saltillo. The agency is setting up another unit in Guadalajara, and hopes to relocate up to 5,000 refugees next year. But the programme would have to be much bigger to resettle the bulk of refugees.

Mr López Obrador has given little sign of how he means to handle the influx. His election manifesto called for a stronger border, but also for protection of migrants’ rights. The current government says it wants asylum-seekers to be able to work while it processes their claims, a measure that the president-elect favours. Alejandro Solalinde, who advises him on migration, told El País, a Spanish newspaper, that Mexico should convert its 50-odd detention centres, from which migrants are deported, into welcoming shelters.

Nor is it clear what will come of Mr López Obrador’s discussions with Mr Trump. During the election campaign, Mr López Obrador said he would not do the United States’ “dirty work” on Mexico’s southern border, implying that he would just let migrants head to the United States. Since his election in July, the two nationalist leaders have been getting along well. They have exchanged letters. The American president is said to have nicknamed his soon-to-be Mexican counterpart “Juan Trump”.

In his letter to Mr Trump, Mr López Obrador proposed a plan to stem migration under which the two governments would spend three times as much on economic development in Central America as they do on border security. That would build on the United States’ pre-Trump policy of spending money to reduce crime and hardship in the northern triangle in the hope of persuading people to stay there.

But such policies demand patience, and Mr Trump is not a patient man. Conflict between the presidents seems likelier than co-operation. Mr López Obrador will probably reject Mr Trump’s request for Mexico to classify itself as a “safe third country”, which would make it nearly impossible for Central Americans to seek asylum in the United States. Mr Trump has cut aid to Central America by 20% and wants to slash it further. He still wants a wall between the United States and Mexico. If Mr Trump gets his way, Mr López Obrador will have to figure out on his own how to care for Alberto, Gabriela and others like them.