The Line Becomes a River. By Francisco Cantú. Riverhead Books; 256 pages; $26. Bodley Head; £14.99.

FRANCISCO CANTÚ signed up for the United States Border Patrol hoping that his experiences would “unlock” the puzzle of the border. But policing the 2,000-mile Mexican frontier, scanning mountain trails for footprints and sniffing the air for rotten corpses, left him only with more questions. “I don’t know how to put it into context, I don’t know where I fit in it all,” he confides one day to a fellow agent. “Damn,” says the other patrolman. “That shit is deep.”

Mr Cantú’s four years on the border provide stories from this no-man’s-land that mix compassion with quiet anger at the cruelty of man and nature. It is wild, untamed country where by night agents douse cacti in hand sanitiser and set them alight for the hell of it. But there is beauty in the desolation. Satellites drift across the clear, starry sky. Mr Cantú has an eye for the flora and fauna of the desert, perhaps because his mother—a second-generation Mexican-American who disapproves of his work—was a park ranger.

His time in the patrol exposes the futility of many of its rules. After discovering a cache of drugs, Mr Cantú suggests following the tracks of the traffickers. “Hell no,” comes the reply of his supervisor. “Suspects mean you have a smuggling case on your hands, and that’s a hell of a lot of paperwork.” Agents sit around smoking cigarettes abandoned by migrants and urinate on their discarded belongings.

Most of the migrants just want to work. One asks to take out the rubbish at the station when he is arrested, just to show willing. A pair from Oaxaca share their packed lunch of grasshoppers, dried fish and mezcal with the agents. The migrants are the subjects of the many moral dilemmas of the border. Making it harder to cross means fewer people will risk their lives to do it; agents slash bottles of water left out in the desert for the desperate. Yet this contributes to unimaginable suffering. A man is discovered curled up, almost dead after drinking his own urine for four days.

The narcotraficantes are a constant, sinister presence. Mr Cantú finds their trucks in the desert and hears their shots ring out across the border by night. Although El Paso, in Texas, is one of America’s safest cities, its neighbour Juárez has one of the highest murder rates in the world. Border Patrol agents are shown images of the narcos’ victims: beheaded, dismembered, faces peeled from skulls. Fortifying the border has driven up smuggling fees, making the business more attractive to organised crime, which now runs it.

Living so close to violence sends people mad, Mr Cantú writes. He is referring to the long-suffering citizens of Juárez. But as he immerses himself in the horror of the border, his own sanity frays. A wolf stalks his dreams. The focus gradually shifts from the vastness of the desert to the claustrophobia of Mr Cantú’s troubled mind.

This is really a book about many borders. One is the line in the sand from the Pacific to the Gulf of Mexico. Another is the psychological divide that sees Americans screen out the carnage occurring a stone’s throw from their own country, “just as one sets aside images from a nightmare in order to move steadily through a new day”.

Finally it is about the divide between the people patrolling the border and those trying to cross it. For Mr Cantú, this wall is broken down when an undocumented friend is detained by the Border Patrol and subjected to its casual cruelties. His compelling, tragic account may help to break down the wall for others, too.