Inmates of the Penal de Ciudad Barrios, reserved for members of the MS-13 gang. All photographs by Adam Hinton

Adam Hinton is one of those people who, after just a few minutes, you feel you’ve known all your life. It is an attribute every photographer needs – the ability to put subjects at ease – but it can also be a life-saver. Literally so, in Hinton’s case, as he has worked in some of the most dangerous places in the world.

“People relax very quickly with me,” Hinton says. “I was with a gang in El Salvador, and after half an hour they said, ‘Do you want to come round the back with us?’ That might have freaked other people out, but they seemed pretty chilled, so I did it. They started smoking dope, then got a gun out. My fixer said afterwards, ‘I’ve never seen that happen within a fortnight [of the first meeting], but it happened to you in a few minutes.’ I don’t go into those situations looking over my shoulder, or looking really panicky. I’m sometimes a bit naively oblivious to what’s going on.”

El Salvador is the latest stage in 50-year-old Hinton’s edgy photographic journey. His day job is in advertising – taking crunchy, sweaty shots for Adidas, Nike and Sport England, as well as for the British army and many charities. But when he’s not shooting ad campaigns, he heads to the world’s trouble spots – not to take photographs on commission, which he says he finds too restrictive, but to do personal photo-essays.

His odyssey began in Donetsk in the early 90s in the wake of the collapse of the Soviet Union. “I went to photograph coalminers, who were heroes of the proletariat and were no longer going to be that. I was interested in how that society was going to change.” He got to know a family in the region, and went back and forth for three years, photographing the community around them. “That became the blueprint for my projects: to work with some families, then discover the community through them.”

‘My sympathies are with these gang members. They’re there; they’re trapped; there’s nothing else they can do.’ Hinton on MS-13 members

Since then he has travelled to Gaza, Egypt, Indonesia, the Philippines, India, Venezuela, Brazil and all over Africa. Much of his personal work over the past decade has focused on the slums of the developing world, and it was as part of that project that, in 2013, he undertook one of his more dangerous trips: to El Salvador, the central American country reputed to have the highest murder rate in the world.

Until he went there, Hinton had avoided documenting gang culture. “Everyone does gangs,” he says, “and my idea was to show that 95% of the people in favelas are normal people.” But when he heard on the BBC World Service that the two big rival gangs in El Salvador – Mara Salvatrucha (MS-13) and 18 Street (Barrio 18) – had agreed a truce, he hoped it would give him space to understand the reasons behind the shootings; to see the people, not the guns.

The truce is now over and the violence deadlier than ever, but in that brief lull, Hinton spent a week in the Las Victorias district of San Salvador, the country’s capital, and visited Penal de Ciudad Barrios – a prison exclusively for members of MS-13. It is guarded outside by the army, but inside, the 2,600 inmates (in a prison built for 800) have free run of the squalid facility, because the guards are too scared to enter. The prisoners have their own bakery, workshops making furniture and toys, and even a rudimentary hospital that they staff themselves.

Hinton has produced an elegant new book with 20 portraits of the heavily tattooed prison inmates. I tell him I find their expressions hostile and disturbing, but he demurs. “I find their faces quite passive,” he says. “They were really warm to me. We just sat and joked.” He says he was completely safe in the prison because he’d been invited in by the gang bosses who run it. Gang law rules. As well as the book, Hinton has posted other photographs he took in the prison and in Las Victorias on his website, plus a short film.

‘I find their faces quite passive,’ Hinton says of the MS-13 members he photographed.

“I’d always avoided gangs,” he says, “but noticed in Brazil how integrated they were with the favela society. It’s a love-hate relationship: they’d be better off without them, but need them to protect themselves from other gangs and from the police. I wanted to go to El Salvador and talk to gang members, but not about ‘How brutal are you? How many guys have you killed?’ None of that knucklehead stuff. I just wanted to ask why they joined the gangs and what the gangs did.”

I wanted to meet gang members in El Salvador, but not ask them, ‘How many guys have you killed?’ No knucklehead stuff

MS-13 and Barrio 18 originated among Salvadoran exiles who, in the 1980s, fled the civil war and settled in Los Angeles. When the war ended in 1992, they were sent back to El Salvador, and brought gang culture with them. Hinton wants to foreground the story of the civil war and the class conflict that still rages in El Salvador. He doesn’t present gangs as mindlessly violent; their violence springs from an impoverished, divided society. One reason he avoids commissions is that he doesn’t want other people’s narratives imposed on him; he prefers to develop his own.

The Penal de Ciudad Barrios is just for members of the MS-13 gang, who run the prison themselves.

In Las Victorias, Hinton had lunch with a gang leader who had just had a young informant killed; attended the wake for a stillborn child who had died because his mother, in prison on a drugs charge, was not allowed to go to hospital in time for the delivery; and witnessed the funeral of a man, not a member of MS-13, who was shot by Barrio 18 just because he lived in an MS-13 district. “I found it shocking that here I am, in a truce, in this community for a week, and they have two gang-related deaths.”

It’s not the violence he wants to emphasise, but the suffering and humanity of most of the residents of Las Victorias. “Rather than seeing these places as threats and full of bad people, my idea is to say: here’s a family; they want the same things as we do; they want a job, a decent home, a better life for their kids. There are basic human needs that everyone has the right to. A lot of my sympathies are with these gang members. They’re there; they’re trapped; there’s nothing else they can do.”

‘There are basic human needs that everyone has the right to’ … Hinton emphasises the humanity of gang members.

Hinton had a poor and dysfunctional upbringing in south-west London. His mother, who worked behind a bar, was a schizophrenic who was imprisoned for stabbing another woman. He resists the reductionist notion that his background feeds his desire to document the suffering of the marginalised, but it’s hard to avoid. It certainly helps to explain how he can have lunch with murderous gang bosses and not panic when guns are brandished. “One of the reasons I don’t get freaked out in those situations,” he says, “is because of the things I saw when I was younger.”

I ask him whether the personal projects keep him sane amid all the commercial work. “They’re what keep me sane, full stop,” he says. “I’m driven to do them, and there’s the hope that they will somehow make a difference. But maybe I’m being naive.”

MS-13, Adam Hinton’s book of prison portraits, is available through paulbelford.com