From the shadows a muscle-bound hulk wearing a garish yellow shirt and with a bible wedged under his arm strode in and ushered the traffickers' leader into the bar. Ten minutes later the leader, an assault rifle laid across his lap, was in tears.

Sobbing, he told his visitor, known in these parts as Pastor Dione, he wanted to leave the gang but didn't know how. The preacher grabbed his arm and tried to comfort him.

"You might think that nobody cares about you," he said forcefully. "But Jesus loves you. And I am here for you. I am your pastor and I will help you."

It has been a violent year even for Rio, which annually registers about 6,000 murders. More than 50 police officers have died since January, while the latest clash between police and traffickers has claimed 16 lives in just over two weeks.

With no sign of the violence abating few are brave enough to reach out to the armed men on the frontline of Rio's 30-year drug conflict. A handful of support groups which aim to draw traffickers back into mainstream, law-abiding, society exists here. Among them is Soldado Nunca Mais (Trafficker Never Again) and Afro-Reggae. But for the most part such work is left to an army of Pentecostal preachers such as Dione dos Santos, the 33-year-old head of the God's Assembly, Restoration Ministry Church, in Senador Cámara, a rundown district in west Rio.

Each week hundreds of these missionaries trawl the back alleys and drug dens of Rio's favelas armed with nothing but a copy of the New Testament, hoping to save both souls and lives.

"My function is to avoid deaths, brother, you get me?" said Pastor Dione during one "incursion", speaking in the same street slang he uses when addressing traffickers.

Alex Casemiro, another preacher, said: "Lots of pastors say they want to preach just so they can sit on their sofa. Very few do what we are doing." He was racing through another slum in his Ford Focus hoping to help free three young men who apparently had been kidnapped and sentenced to death by a drug gang from another favela.

Like the UN and Red Cross, Rio's frontline preachers possess a type of carte blanche to operate in the city's most inaccessible and dangerous corners. When Rio's police try to enter a favela, they are often received with gun fire; when the evangelists do so they are greeted with a slightly embarrassed smile or a hug from the gang members.

"No one here is so up themselves [that they reject the preachers]," one high-ranking trafficker from the Third Command drug faction told the Guardian during a recent visit to one of the group's HQs, a concrete shack manned by young traffickers armed with AK-47s and an anti-aircraft machine-gun capable of firing up to 500 rounds a minute. "The boys all know they are here to try and liberate us, to help us stop smoking, stop snorting and stop trafficking."

Many such preachers are former gang members who see the traffickers not just as violent killers but also as deeply vulnerable young men.

Pastor Dione, who said that until 10 years ago he was also in the drug "movement", often tells traffickers: "What you are, I once was. What I am today, you too can become."

On one missionary visit, and referring to Rio's four main drug factions, he told an AK-47-wielding trafficker: "A life is a life. It doesn't matter whether you are TCP, TC, ADA, CV or whatever. Think about it. Take two hours out for God and come to the church."

Not all of the preachers' beliefs are as progressive as their attempts to rescue gangsters might suggest. Many consider homosexuality the work of the devil and encourage their female worshippers to cover themselves with the roupao, a baggy body-length robe.

Yet the results of their highly risky visits to Rio's slums are impossible to deny. Pastor Dione claims to have convinced several hundred criminals to swap their weapons for the word of god.

"If it wasn't for the pastor I'd be dead already," said one teenage recruit, who claimed that before his conversion he had been employed to chop up corpses with an axe. A 21-year-old, Marcelo dos Santos, one of the youngest members of Pastor Dione's team, said: "My mum gets worried about the early mornings and the shootouts but this is our work, our lives are in the hands of Jesus."

A garage holding mattresses and wooden pews serves as Pastor Dione's church. At a recent gathering the immaculately dressed evangelist was on stage preaching at the top of his voice to a heaving audience. "Do you know what I say to the believers who are scared of evangelising in the drug dens?" he bellowed. "Stop clowning around! Today we are going out onto the streets. Today we are going to invade the drug dens."

"Hallelujah!" the worshippers screamed back.

After the service Pastor Dione and eight colleagues piled into a white VW van and went out into the night. Two hours later they pulled up at a roadblock in the Complexo da Mare, a slum near Rio's international airport. Half a dozen traffickers, carrying grenades, revolvers and automatic rifles, surged round the van to receive a blessing.

"Come with us now! Put your gun down and come with us back to the church," the preachers insisted, prompting an uncomfortable silence.

After several hours preaching, Pastor Dione's men were ready for bed. They gathered in a bar to discuss the night's events over Coca-Cola. It was nearly 5am. "Who else comes here and hugs the drug traffickers?" asked Pastor Dione. "[The traffickers] think 'the state doesn't care about me [and] the police come in here shooting, and these people come in here telling me I matter, that Jesus loves me' - this is our mission."

Favela fight

Red Command, Third Command, Pure Third Command, and Friends of the Friends, are the four main drug factions controlling many of Rio's 600 shantytowns, home to about 1 million Brazilians.

Estimates suggest there are at least 6,000 young men involved, some as young as 11.

Since the 1980s, clashes between rival factions and police have become increasingly militaristic. Police frequently seize machine-guns and rifles, while landmines and bazookas have also been found.

Civilian casualties have risen this year as the authorities pursue a more aggressive stance against the drug factions. The state security secretary, Jose Beltrame, recently said he could not "make a cake without breaking eggs", referring to the civilian casualties that occurred in one police raid.