Mexico's campaign to stem a tide of illegal immigrants from Central American countries to the United States has led to a surge in complaints of abuse by migration officials, including violent attacks and extortion.
Under U.S. pressure, President Enrique Pena Nieto in July 2014 launched a plan he said would make Mexico's southern border "safe for Mexicans and migrants alike".
Since then, the number of Central American migrants - mainly from Guatemala, El Salvador and Honduras - caught trying to enter the United States has fallen markedly. But complaints of abuse at the hands of Mexican officials shot up around 40 percent, data obtained by Reuters shows.
Dubbed "Frontera Sur", Pena Nieto's plan set out to tighten border controls, register migrants and discourage their use of dangerous transport north such as an infamous train known as "La Bestia" (The Beast), which criminal gangs have long targeted.
Despite also pledging to protect their rights, migrants complain the opposite has happened.
In the year through June 2015, Mexico's National Commission on Human Rights (CNDH) logged 567 complaints of abuse by officials at the National Migration Institute (INM), up by 39 percent from the previous 12-month period.
That far outweighed a slight dip in complaints against police during the same period, to 83 from 92, according to CNDH data requested by the Washington Office on Latin America for an upcoming report.
Activists say the vast majority of abuses go unreported but that anecdotal evidence supports the increase shown by official data.
"Plan Frontera Sur has turned the border region into a war zone," said Alberto Donis, managing director of the Hermanos en el Camino shelter, near the migrant stopping-point of Ixtepec in Oaxaca state. "Talk of human rights is a lie. Almost all of the migrants who arrive here have been abused by authorities."
Evidence that migration officials harass and abuse Central Americans sits uncomfortably alongside Mexico's condemnation of U.S. presidential hopeful Donald Trump for labeling Mexican migrants as rapists and drug runners.
So worried are some migrants about being attacked in Mexico that they reported climbing trees and using belts to tie themselves to the upper branches so they can sleep in peace.
Delivered by migrants or legal intermediaries, the CNDH testimonies accuse Mexican officials of beatings, extortion, robbery and willful neglect.
INM spokeswoman Sofia Vega declined to comment on the CNDH findings but said Plan Frontera Sur "has provided countless benefits to people of different nationalities."
'LEGALIZED ANARCHY'
The migrants' path through Mexico is a map of violence and extortion and is studded with sites of atrocities like the 2010 massacre of 72 migrants near the northeastern town of San Fernando by the Zetas drug cartel.
Mexican drug gangs have long preyed on migrants crossing their turf, but they face competition in the criminal food chain from corrupt officials.
Shelters offer scant respite. Overwhelmed and understaffed, many resemble refugee camps, with space, water and food scarce.
For accountancy student Victor Santos from El Salvador, crossing Mexico is now even more dangerous than it was.
In March, the 21-year-old was deported for the sixth time in three years after he was pulled off a bus by six Mexican migration agents outside El Ceibo, in Tabasco state.
He said he ran off, but the agents caught up with him, beat and robbed him and then deported him. "They hit me and took $1,000," he said by telephone from El Salvador.
Santos said he filed a complaint against the officials while being held at an INM detention center, but was removed from Mexico before it was processed.
INM spokesman Ruben Dario Garcia said the agency had no knowledge of the incident.
Pena Nieto unveiled his southern border strategy after a jump in detentions in the United States of unaccompanied minors from Central America created a political crisis for President Barack Obama last year.
The U.S. government stepped up efforts to secure its border and Mexico began deporting many more migrants before they could reach the 3,200-km (2,000-mile) frontier.
The flow of migrants duly slowed. From October 2014 through August 2015, the number of minors caught travel ling alone at the U.S. border fell by nearly half to 35,494.
Total border apprehensions dropped by a fifth to 249,726 between July 2014 and March 2015, the last month for which U.S. Customs and Border Patrol data is available.
Meanwhile, deportations from Mexico in the first five months of 2015 rose more than 70 percent from the same period in 2014 to nearly 68,000.
To escape deportation, migrants often pay bribes to INM agents of between $30 to $300, according to testimony from dozens interviewed by Reuters.
Gonzalo Chavez, an Ixtepec-based immigration lawyer working for the attorney general's office of Oaxaca state, said Pena Nieto's plan has created a "climate of legalized anarchy".
Among migrants he has represented is Carlos Arevolo, a 40-year-old Salvadoran who reported witnessing INM officials setting fire to a field of long grass where he and three others were hiding to avoid capture.
"I saw a lot of fire and smoke and heard people screaming," Arevolo said in testimony registered at the Ixtepec public prosecutor's office after he alone escaped the INM officials.
Authorities did not address the men's complaints because the other three were quickly deported and Arevolo had no fixed address in Mexico, Chavez said.
(Editing by Dave Graham and Kieran Murray)