Terrible violence had spread across Central America. Desperate to escape, thousands sought refuge in the United States. Many arrived illegally. For a long time, they lived in the shadows. But then a bold president coaxed and cajoled Congress into passing a major immigration reform. The Central American migrants at last gained the right to live in the United States legally.

It’s a decades-old story that contains the origin of the present-day border crisis, which has brought thousands of unaccompanied Central American children to the United States in the hopes of gaining residency.

The year of that first amnesty was 1986. The amnesty was followed by various extensions and additions, including a 1997 act specifically aimed at displaced Central Americans. Between 1980 and 2000, the number of Central American immigrants living in the United States jumped from 350,000 to more than 2 million (as of 2010, the total exceeded 3 million).

This newly settled community included many victims of violence. It also included many perpetrators of violence. Civil wars don’t usually divide neatly between victims and victimizers. Former guerrillas and former soldiers arrived in the slums of Los Angeles—and some of them responded by founding criminal gangs to protect themselves and earn a living. It was Los Angeles, not San Salvador, that gave birth to MS13, famously described as the “world’s most dangerous gang.” InSight Crime offers an overview of the group’s formation:

[T]he war-hardened immigrants quickly organized themselves into competing groups, the strongest of which was called the Mara Salvatrucha. The gang was initially composed of refugees from El Salvador in the Pico Union neighborhood, which is where the name comes from: “mara” is a Central American term for gang; “salva” refers to El Salvador; “trucha,” which means “trout” in English, is a slang term for “clever” or “sharp.” However, with the concentration of Spanish speakers in Los Angeles, the gang expanded into other nationalities and then into other cities.

In the American melting pot, Central American gangs quickly lost their national distinctiveness. Mara Salvatrucha changed its name to MS13 for the same reason that British Petroleum changed its name to BP—to de-emphasize its local roots and rebrand itself as a global competitor. U.S. law enforcement eventually caught and imprisoned thousands of Central American gangsters. When they were released, they were deported to their countries of origin. Perhaps as many as 20,000 returned home between 2000 and 2004, bringing with them the criminal organizational skills honed in American barrios and prisons.