They were given one of the most dangerous orders in policing: Take down MS-13.
They were bankrolled by the United States and trained by FBI agents.
But members of the Salvadoran police have been killed by the dozens in each of the past three years, most in attacks that investigators and experts blame on MS-13, an international street gang. At least nine officers were killed in the first month of this year.
Now, a number of El Salvador's police officers are fleeing the gang they were tasked with eliminating.
There is no list in either El Salvador or the United States of Salvadoran police officers who have fled the country. But the Washington Post has identified 15 officers in the process of being resettled as refugees by the United Nations and six officers who have either recently received asylum or have scheduled asylum hearings in US immigration courts.
In WhatsApp groups, police officers have begun discussing the possibility of a migrant caravan composed entirely of Salvadoran police - a caravana policial, the officers call it.
The exodus of Salvadoran police points to how the country's security forces have failed to break the stranglehold of organised crime. It also shows that among those seeking refuge in the United States during the Trump Administration are some of America's closest security partners.
"These are among the most vulnerable people in El Salvador," said Julio Buendia, the director of migration at Caritas El Salvador, a nonprofit organisation that works with the US and United Nations on refugee resettlement.
The US has been bolstering the Salvadoran police, part of a regional strategy intended to stabilise Central America's most violent countries and reduce migration. The State Department spent at least US$48 million to train police in El Salvador, Guatemala and Honduras from 2014 through 2017, according to the Government Accountability Office.
The department opened a law enforcement training academy in San Salvador, where 855 Salvadoran officers were trained by the FBI and other American law enforcement agencies in those four years.
"The Salvadoran Government, with US Government support, has made significant gains in the area of security, including reductions in homicides and every other category of violent crime measured," the State Department said.
Citing "privacy reasons," the department would not comment on whether it was receiving asylum or refugee applications from Salvadoran police officers.
By some measures, the US-backed security efforts appeared to be showing results. In 2018, El Salvador's homicide rate was 50.3 per 100,000 inhabitants. That was still among the highest in the world, but it was down from 60.8 per 100,000 in 2017 and 81 per 100,000 in 2016.
MS-13 was born in Los Angeles in the late 1970s, expanding as more Salvadorans arrived in the United States after fleeing the country's civil war. The group splintered, with Barrio 18 becoming a chief rival, and both groups grew in American prisons before reaching El Salvador through mass deportations. Between 2001 and 2010, the US deported 40,429 ex-convicts to El Salvador, according to the Department of Homeland Security.
El Salvador's Government adopted an "iron fist" response to the gangs, including more police operations. When that approach failed, it tried to broach a truce with the gangs in 2014. The pact quickly disintegrated and was followed by another surge in violence. It was then that the gangs began to explicitly broadcast their threats against police officers.
"If you kill a 'pig,' or a police officer, you're more respected in these gangs. That's the policy - using death as exchange currency," said Hector Silva Avalos, a journalist and researcher who has written a book on the Salvadoran police and has served as an expert witness at several asylum hearings for former police officers in the US.
With salaries of US$300 to US$400 per month, the low-level police officers who make up the majority of the force often have no choice but to live in neighbourhoods vulnerable to gangs. And so, in the majority of the cases, police officers are killed when they are home from work or are on leave.
In August, Manuel de Jesus Mira Diaz was killed while buying construction materials. In July, Juan de Jesus Morales Alvarado was killed while walking with his 7-year-old son on the way to school. In November, Barrera Mayen was killed after taking leave to spend time at home with his family.
The police investigated a number of the killings since 2014 and found members of the major gangs responsible.
"They have more control than we do. When we go home, we're in neighbourhoods where there's one police to 100 gang members. We're easy victims," said one officer in the country's anti-gang unit, who, after being threatened by MS-13 in his home, is awaiting refugee status from the United Nations.
Complicating their response to the threats, Salvadoran police are also not legally allowed to take their weapons home with them.
"I bring it home anyway. I sleep with it on my waist," said a female officer, who is awaiting refugee status from the United Nations. "My husband and I take turns sleeping. We know they are going to come for us."
Many units in the Salvadoran police are forbidden to wear balaclavas to conceal their identities. In anti-gang units, officers are allowed to wear such masks during operations, but they are frequently asked to testify in court, where they must show their faces and identify themselves by name while gang members look on.
In 2017, El Salvador's attorney general, Douglas Melendez, urged the government to do more to protect off-duty police, asking the Parliament to pass a "protection law" for police and soldiers that would also provide funding to protect their families. The law was never passed.
Many officers, feeling unprotected by their own force, have said their only option is to leave the country.