TAPACHULA, Mexico -- Leaving El Salvador had never been in Alberto's plans. He and his wife had stable jobs and supportive friends and relatives, and their five children were happy.
But a local gang tried to recruit one of Alberto's sons as a drug mule and beat him up when he resisted, the family said. A gang leader approached his daughter, then 10 years old, and told her that he was going to make her his girlfriend. Then Alberto and his family received a phone call threatening to kill them if they did not turn over the children for the gang's use. The corpse of a boy even appeared on the street in front of their house.
The family fled north, taking only what it could carry.
''We can't just hand them over to the gang,'' Alberto said of his children, sitting with his family in a shelter in Tapachula, a small Mexican city near the Guatemalan border. (Like other migrants interviewed, Alberto and his family asked that their last name not be used, fearing their persecutors could find them.)
Gang violence in El Salvador, Honduras and Guatemala has conspired with economic desperation to drive an unrelenting exodus of migrants, including entire families, seeking safety in other countries, mainly the United States.
Despite American-backed efforts to tighten regional borders and address the root causes of the exodus, American and international officials say the migration numbers have soared in the past year.
''It's really a refugee crisis,'' said Perrine Leclerc, the head of the field office for the United Nations refugee agency in Tapachula.
In the 2016 fiscal year, which ended in September, nearly 409,000 migrants were caught trying to cross the southwestern border of the United States illegally, a 23 percent increase over the previous fiscal year, according to statistics released by the Obama administration. Officials said the increase reflected the growing number of people heading north, not any sweeping changes in enforcement.
The trend continued through October, according to figures released Thursday by American immigration officials: More than 46,000 people were caught last month on the southwestern border, up from about 39,500 in September.
The recent flow has been particularly notable for the unusual number of Central American migrants traveling in family groups. In the most recent fiscal year, about 77,700 migrants caught on the southwestern American border were traveling in families, nearly twice as many as were detained in families the previous year. About 91 percent of all those migrants were from El Salvador, Honduras and Guatemala, a region known as the Northern Triangle.
As part of his presidential campaign, Donald J. Trump promised an unforgiving approach to illegal immigration, including building a wall along the border with Mexico and stepping up deportations beyond even President Obama's record removal rates. Now, among the array of immigration challenges he will face upon taking office, Mr. Trump will have to contend with this surge of migrants, an issue that has overwhelmed not only American border officials but also governments throughout the region.
Some American officials have floated the theory that families may be migrating together in the hope that adults will have a better chance of avoiding detention in the United States if they try to enter with children.
But interviews with migrants and their advocates suggest that families are fleeing -- sometimes in groups of as many as 15 people -- because they have no alternative. Gangs in certain communities in the Northern Triangle have become so merciless, and their control so widespread, that a family is often left with a stark choice: Comply, flee or die.
''Today the violence is widespread, and because it's widespread, it's affecting the whole family,'' said Diego Lorente, the director of the Fray Matias de Cordova Human Rights Center in Tapachula.
Almost all of the migrants said they had once had no intention of ever leaving their countries.
Alberto said he had a thriving business breeding livestock and dogs. His wife ran a food stand. Their youngest children were on track to attend college, he said. They were active members of their church.
The family first fled in 2013 to northern El Salvador, where Alberto rebuilt his business and the children returned to school. But the gang members tracked them down, forcing them to move two more times, he said. They finally fled the country in March.
While staying at a migrant shelter run by the Catholic Church in southern Mexico, a nun told them about Mexico's asylum program. They applied and are now waiting for their claim to be adjudicated.
''What can I say?'' Alberto said with a sigh. ''This is the horrible reality that our country is living now.''
As the violence and impunity have soared in the Northern Triangle, so has the number of asylum claims from those countries, according to the United Nations. Nearly half of those asylum seekers this year have sought sanctuary in the United States. But migrants are increasingly viewing other countries in the region, including Belize, Costa Rica and especially Mexico, as asylum destinations.
Under international pressure, the Mexican government has been expanding its capacity to receive refugees. Its acceptance rate for completed applications increased to about 62 percent in the first six months of this year, from about 45 percent in 2015.
United Nations officials and migrants' advocates here believe that of the hundreds of thousands of Central American migrants who crossed into Mexico last year, as many as half may have qualified for refugee protection. Yet only about 3,400 people applied for asylum in Mexico, according to government figures. By comparison, nearly 177,000 Central Americans were deported by Mexican immigration authorities last year.
The migrant shelters here in Tapachula are full, and advocates are struggling to accommodate the growing number of families that find their way here, either as a pit stop on their journey to the United States or as a place to file for asylum.
''Tapachula is the first place that they arrive where they have a perception of security,'' Mr. Lorente said.
The migrants tell of grisly murders, of how gangs have recruited boys as lookouts and drug runners and forced girls into becoming their brides. They speak of ''war taxes,'' sometimes amounting to half of their earnings. Noncompliance is met with death.
''It's butchery,'' Ms. Leclerc said.
Entire neighborhoods have fallen under the control of gangs, which are abetted by corrupt officials on their payrolls. Several migrants said they had not reported crimes to the police, fearing that the police would inform the gangs.
Most said they had left their homes with no understanding, or even awareness, of asylum protections in other countries, only a determination to find a safer place to live.
Fatima, 19, said she had fled El Salvador after gang members killed her husband, an apprentice auto mechanic, and threatened her, too. Traveling with her 2-year-old son and two close relatives, she was hoping to reach the home of her late husband's parents in the Mexican state of Puebla.
The women knew nothing about asylum protections in the region. So when immigration officials caught them, they did not know they could present their case, they said, and the immigration officials never asked why they were migrating.
The women said they and their children had been deported back to El Salvador, but immediately headed back to Mexico. They were captured again. But this time, Fatima said, she spotted United Nations posters on the wall advertising the Mexican asylum program.
''It was never in my thinking to leave my country,'' she said at a migrant shelter in Mexico City.
Fatima said she hoped to remain in Mexico and had not considered trying to move to the United States. But according to some migrants' advocates, the goal for most Central American migrants is to eventually make it ''farther north,'' a phrase common among migrants. Even many of those applying for asylum in Mexico view refugee status as a stopgap allowing them to travel to the northern border without harassment by the Mexican authorities.
''It's the superbest country,'' Juan, a Honduran migrant, said of the United States. He has applied for refugee status in Mexico, along with his wife and two small daughters, but he hopes to reach America. He said they had fled Honduras after gang members threatened to kill him if he did not join their operation.
''You don't migrate now in search of the American dream,'' he said. ''You go for your life.''
PHOTOS: Migrants from Honduras and El Salvador at a shelter in Tapachula, Mexico, near the Guatemalan border, one morning last month. ''It's really a refugee crisis,'' a United Nations official there said.; A Salvadoran family at a shelter in Mexico City. Migrants increasingly see Mexico as an asylum destination. (A6); Migrants from Honduras in Tapachula, Mexico. The number of families caught at the American border has risen sharply. (PHOTOGRAPHS BY MAURICIO LIMA FOR THE NEW YORK TIMES) (A8) MAP: As gang violence has soared in the Northern Triangle region, so has the number of asylum claims from those countries.