MS-13 is like a surrogate family. Members join for many reasons but mostly because they are vulnerable, marginalized and lacking any clear way to climb the social and economic ladder. What they find in the gang is a close-knit group that they think of as source of protection.

MS-13 members call this cocoon “el barrio.” El barrio is part of a mythic notion that if you commit yourself to something that is bigger than yourself, you will be rewarded with respect, status and comrades who will have your back when someone from outside threatens you.

El barrio is an ethos that can be evoked for good and for bad, including extreme violence, predatory criminal behavior and brutal forms of social control that have led to thousands of deaths in the United States and across Central America.

Both the church and the gang are tightly knit social organizations, places where people find an alternative family that require deep emotional and time commitments. Church members address one another as brother and sister, and like gang members, they are expected to look out for one another, providing jobs, shelter and food when needed. Churches are also highly patriarchal.

Many evangelical churches tackle the gang menace not just on a spiritual and an emotional level but also a practical one. They provide jobs and job contacts, informal child-care services, and access to health care. Perhaps most important, they monopolize their members’ time. Church services happen every night or nearly every night, coinciding with the hours when gang members are expected to “hangear,” as they like to say in Spanglish, with fellow gang members.

This transition to religion suggests that we should devote an equal amount of resources and rhetoric to creating an alternative to MS-13’s barrio, a space that nurtures youth rather than marginalizes, incarcerates and deports them.

Safe spaces include religious institutions but could also include gang-free schools where at-risk youth get emotional as well as practical and financial support. While law enforcement will remain a necessary component in anti-gang strategy, commitment to these types of prevention and exit strategies is the only way to blunt the gang’s influence over the long term. But these programs receive pennies compared to the recent law enforcement initiatives aimed at the gang.

Dramatic as his breakdown in the church was, Mr. Deras’s slide from gang life happened over time, as he worked to integrate himself into his new religious community. It was also a while before Mr. Deras felt that he could tell the gang leaders he was going to church regularly. When he did, they didn’t tell him to stop but rather, the opposite: embrace it, they said.