Author's Note: Some names have been changed and some details have been left vague in order to protect the identity of the people concerned, for fear of reprisals against them.

"This is one of them."

When Qudrah heard those words, he knew exactly what was about to happen. The young student had been attending a birthday party at a hotel in Bauchi in predominantly-Muslim northern Nigeria, when Islamic officials and policemen arrested him and several of his friends.

According to Qudrah, they were interrogated and beaten every day for around a week, as the prison wardens tried to make them confess they were gay: "God is angry with Nigeria because of people like you," they said.

Tried later in a Muslim court, Qudrah was eventually released when prosecutors could find no evidence against him. But his troubles didn't stop there. When news got out of his release, a crowd gathered at his house and threatened to kill him. He fled to a neighboring town.

As homosexuality becomes more mainstream and open in the United States and Europe, there has been a range of reactions in Muslim-majority societies. In some places, like Lebanon and Palestine, the tolerance for members of the LGBT community to express themselves has opened up somewhat. But elsewhere, as in Turkey, Iran, Nigeria, and Malaysia, the reaction among conservative Muslims has been to vilify homosexuals.

In Nigeria, mob violence against gay men has become increasingly common since January 2014, when President Goodluck Jonathan passed a harsh law criminalizing same-sex relationships throughout the country. Arrests have spiked, witch hunts have targeted activists, and the local media has promoted a campaign against homosexuals.

For Muslims who happen to be gay, Nigeria, with its current climate of intimidation and persecution, is one of the world's most unforgiving places. And in its Muslim-majority north, gays face some of the most severe punishments, such as death by stoning under Shariah law.

"This is a backlash against what's happening in the West," says Dorothy Aken'Ova, executive director of Nigeria's International Center for Reproductive Health and Sexual Rights. "Some people say this is a preventative measure, and they don't want to get [to where the west is]."

Where Gay Muslims Face Punishment

According to a report in the Washington Post, ten countries impose the death penalty for homosexual acts: Saudi Arabia, Sudan, Yemen, Iran, Mauritania, parts of Nigeria and Somalia, the United Arab Emirates, Iraq, and Qatar. All are Islamic states, or, as in Nigeria's case, the legislation exists in Muslim-majority parts of the country. In some countries, these laws are based on colonial-era penal codes from the 19th century.

Three men in Iran were executed on homosexuality charges in September 2011. In March 2012, an unknown number of gays and "emos"—youths who dressed in an alternative fashion—were bludgeoned to death in Iraq.

Some Palestinian youths become suicidal, because of family and societal rejection, but are still coerced into marrying members of the opposite sex, according to Ahmad, a member of Al Qaws, a Palestinian LGBT advocacy group based in Jerusalem.

Over the last decade or so, fifteen countries have legalized same-sex marriage, all of them in Europe and Latin America. Parts of the U.S. and Mexico have also done so. Over that time the issue of homosexuality has been brought into sharp relief in many Muslim communities. But in some places, like Malaysia, where homosexuality had been tacitly tolerated as a part of the culture, the reaction has been stern.

Malaysia's Department of Islamic Development said in October 2013 that a local gay rights coalition's support of LGBT issues were a threat "to the sovereignty of Islam." A March 2013 United Nations human rights report condemned Iran's anti-gay laws. In response, the head of Iran's High Human Rights Council, Mohammad Javad Larijani, said homosexuality is an illness, and that Iran is being forced to accept Western norms.

Islam's Stance on Homosexuality

Most traditional Muslim scholars agree that Islam condemns homosexuality, citing many verses in the Quran and Hadiths (the sayings attributed to Prophet Muhammad) to support their argument. According to Mission Islam, an online network, every major Islamic school of thought considers sex between two men to be sinful and unlawful, calling it "deviant behavior."