On a Friday night a few weeks ago, Ibrahim “Ibby” Mamood was frantically typing on his laptop, shaking, with droplets of sweat dripping from his forehead. Every so often, he peered over his shoulder, just in case someone was still awake and could come into his room. “I did it again,” he typed to the members of a private Facebook group. “I lost control of myself. May Allah, the greatest, the most kind, the most merciful, forgive me.”

Mamood, 27, lives in Birmingham, one of Britain’s largest cities and home to the country’s largest Muslim population outside of London. He’s a practicing Muslim who prays five times a day and teaches children in madrassa (Islamic school). He lives in a neighborhood almost entirely filled with Muslim families, all of whom know each other, attend the same social events and congregate at the same mosque.

This makes what he calls an “addiction” to masturbation even harder to talk about. Calling me from a cafe in central Birmingham, far away from his home, he says that he started masturbating in his late teens “without really knowing what I was doing.”

“It started, like most boys, with wet dreams. I thought I was wetting the bed. And it really developed from there. Later, I looked at pornographic images. Not because of a sinful sexual attraction. I wanted to figure out what was happening to my body.”

Illustration by Dave van Patten

Mamood tells me that as he grew older — and with Islamic marriage on his mind — he attempted to become a more devout Muslim. As he was doing so, however, he continued looking at pornography. “I knew what I was doing was wrong… I’ve always known that. But we live in a society where pornography is widespread, so even when I wasn’t looking for porn, it was just there.”

Like many Muslim men in Mamood’s situation — i.e., finding themselves unable to talk about sex, masturbation or porn in deeply religious communities, where such things are considered taboo — he turned to the internet for help. In addition to private groups on Facebook (Mamood’s has more than 200 members) and WhatsApp, the biggest support network is on Reddit, where the MuslimNoFap subreddit has about 2,000 followers.

On the surface, it might seem like the normal Reddit NoFap community, a group of men whose choice of abstinence is largely driven by a desire for self-improvement. But according to members of MuslimNoFap, who all wished to remain anonymous, their community is much different. As one told me, “The main NoFap community is largely aiming to somehow assert their masculinity through control of themselves, with the hope of sleeping with women outside of marriage.” Conversely, the MuslimNoFap community is designed to uphold the sanctity of Nikah (marriage), which also means that “any form of sexual activity is prohibited until made permissible by Allah.”

“All we’re trying to do is serve Allah, and to do what he commanded us to do,” the MuslimNoFapper adds.

While the men I spoke to had joined the group for different reasons — some wanted to stop watching porn; others used to the group to manage depression and anxiety — nearly all of them wanted to get married in a halal (Islamically permissible) way, and were worried that their affinity for porn and masturbation would nullify their marriages in the eyes of God. It also was clear that despite thinking about marriage for much of their lives, none of these men had been prepared for what would happen on their wedding nights.

“There’s no way we can talk about sex, or anything to do with sex inside a mosque. It’s impossible,” a Canadian man by the username Abu Khadeer says. “Most of the people in these groups had a strict Islamic upbringing. They didn’t learn about sex education in the madrassa, where they were prohibited from having girlfriends. Some date and have sex outside of marriage, but [most] other men are truly devoted to their religion. They end up giving into temptation … usually because they’re afraid they won’t be competent when they finally get married.”

“Most mentions of sex in the [mosque] are usually associated with sin,” he adds. The attitude that the imams take is that any sort of deliberate extramarital sex is a severe sin — one that results in punishment in the akhira [afterlife].”

Islamic scholars differ in their opinions of this interpretation. The mainstream view among some world-famous preachers, including Zakir Naik, is that anyone engaging in extramarital sexual activities without repentance (in the form of fasting and prayer) will be sent to hell on Judgment Day. Others say that because the Qu’ran doesn’t specifically call masturbation zina (a major sin), severe punishments don’t apply.

Still, most devout Muslim men grow up being told to stay away from any type of sexual activity until marriage. As Abu Khadeer says, “A lot of us are told to be celibate up to the point of marriage. And then when we get married, we’re just expected to know what to do. One of the guys on the forum had to divorce his wife because he couldn’t consummate his marriage. He literally didn’t know how to have sex with her on his wedding night.”

It’s difficult to quantify the problem, but most of the imams I spoke to recognized that this is an issue that is often kept secret. Imams from progressive Imams Online network say Islamic leaders hadn’t really dealt with situations involving men and sex education, beyond very extreme situations — ones where the men believed they’d been possessed by evil spirits, in which case, the imams recommend long periods of praying and fasting, or sometimes ruqyah, an Islamic exorcism ritual.

“Things like sexual etiquette aren’t taught in Islamic schools, because there’s an aversion by teachers who believe it’s a parent’s duty to teach their children about sex, but many parents don’t feel confident talking to their sons about sex either,” says London-based imam Muhammad Jafer. “As a result, you have young men who reach their 20s knowing next to nothing about intimacy, or worse, they’ve learned about it by looking at sinful websites or talking to people about sex in haram [forbidden] environments.”

Illustration by Dave van Patten

Plus, as Mamood points out, “Most [imams] are older men, who grew up at a time when getting married young was something everyone did, so they don’t understand the world we’re in now. [They] don’t understand how much our society is sexualized now. To say that we should abstain from pornography is impossible.”

“The problem begins when you say abstinence is the only option,” adds Imtiaz Ayub, a social worker based in Derby, a small city in the north of England. Ayub isn’t an imam, but much of his work involves working with Muslim teenagers, including getting them to open up about sex. “There’s a wider problem here — one where in Muslim communities this idea of a very macho masculinity is imposed,” he explains. “More and more young Muslim men are obsessed with how they look, how muscular they are, as a way to prove they’re manly. But at the same time, they’re not encouraged to talk about their own sexuality. That can be very confusing for [them].”

In Ayub’s opinion, communities that have told young men to disregard their sexuality are “basically waiting for a volcano to erupt.”

“Muslim boys aren’t different to any other type of male — they’re going to be sexually curious when they reach a certain age, and if communities care about them, they need to provide spaces where they can openly talk about sex without the taboos. You can’t expect young Muslim boys to grow up and become men unless they’re able to manage the period when they grow up to become men.”

His attitude is shared by others who are trying to offer better resources for Muslim men to talk about sex. In the U.S., a website called “Purify Your Gaze” provides interactive sessions via Skype — usually involving a mentor — and other specially designed programs, consisting of physical activities and Islamic prayers, to aid men throughout their “healing” processes from porn and masturbation. Others, like U.K. imam Alyas Karmani, take a more modern approach — one that disregards notions of personal sexual gratification as a major sin, earning him the title of the “Muslim Sex Doctor.” Same for Mufti Abu Layth, another British imam who caused controversy when he used his weekly advice session on Facebook Live to say that masturbation wasn’t prohibited in Islam at all. Instead, he believes past Muslim scholars had suggested that masturbation could be used to safely manage one’s sexual desires.

To Ayub, Mufti Abu Layth’s statements were a positive first step. “The Mufti has a big public platform, and it was important for him to say that. Even if there are Muslim men who want to be celibate, who want to abstain until marriage, it’s still important for them to understand that masturbation is a natural human thing.”

A few days ago, I spoke to Mamood again. He was in better spirits. He’d put blocks on the porn sites he’d visited, and following the advice and encouragement of the other members of his anti-masturbation support group on Facebook, he’s trying to combat his sexual urges through studying Islamic books. That said: “I’m fine during the day, when I can control my temptations. It’s moments at night when I’m alone…,” he admits.

He takes a long pause, and then mutters a short prayer in Arabic asking for God’s forgiveness. “Those are the times I’m worried about. It’s at night time, when the devil likes to tempt us, especially on the internet.”