As gang wars drive Brazil’s homicide rate to historic highs, evangelical pastors — long revered in the nation’s slums and prisons — have come up with a new way to protect members looking for a way out.

Gang leaders say the only way to leave the business alive is to convert to Christianity. So Barros, a televangelist popular here in western Brazil, memorializes a gang member’s embrace of the ancient articles of faith using the most modern of tools: He records the conversion on his smartphone and posts the videos on YouTube, Facebook and WhatsApp. The converts gain immunity against retribution by rival gangs and their own.

Gang leaders and law enforcement officials say it works.

“We aren’t going to go against the will of God,” a local leader of the powerful Comando Vermelho, the gang that was pursuing Viera, told The Washington Post. “God comes first, above everything.”