As reports emerge that Omar Mateen used a gay dating app and patronized the gay nightclub Pulse, so has speculation that he may have been deeply conflicted about his identity. Whether that proves true or not, Mr. Mateen may have been influenced by jihadi views – either as justification for the mass shooting, or as a source of inner conflict that shaped his decision to attack.

Thousands of sympathizers with the self-declared Islamic State (IS) either praised the attack, which killed at least 49 and injured dozens more, or dismissed the dead as “merely gays.”

“Rejoice, for they are gays such as Lot in Sodom, where God unleashed upon them his torment,” one sympathizer tweeted.

Mateen, who pledged alliance to IS, also reportedly followed the propaganda of Al Qaeda, which has called for the killing of “deviants” such as gays. In April, the group’s branch in the Indian subcontinent assassinated an LGBT magazine editor in Bangladesh in a bid to prevent the “promoting of homosexuality.”

Celebration of the Orlando attack across jihadist social media and in certain Islamist circles highlights the acrimonious relationship Islamist groups have long had with the LGBT community. IS has killed homosexuals with particularly brutal zeal, and in some Middle East countries homosexual relations are considered crimes punishable by death. While IS cites the Quran as its authority, Muslim clerics are far from agreement on how homosexuals should be treated.

Salman al-Odah, a leading Saudi cleric with 9 million Twitter followers, said in an interview with a Swedish newspaper April 30 that even though homosexuality is considered a sin in the Torah, Bible, and Quran, according to Islam the punishment comes in the next world, not this one.

"Those that say homosexuals are deviants of Islam, they are the true deviants and their actions are a graver sin than the homosexuals themselves,” he added, in a statement on his website.

What the Quran says

IS takes a far less nuanced view, attempting to take justice into their own hands.

Syrians who have fled IS-held strongholds of Raqqa and Deir Ezzour told The Christian Science Monitor late last year that IS has built a network of religious police and “informers” to oust those suspected of “sexual deviancy.”

“The hisbah [ISIS religious police] ask us about our neighbors and relatives – why some are not married, have no children, or dress a certain way,” says Mohammed, a 24-year-old refugee from Deir Ezzour who now lives in the Azraq refugee camp in Jordan. “If they find someone who has refused to marry and has many friendships, they believe he may be gay and therefore must be killed.”

In August 2015, members of the LGBT community from ISIS-held Syria and Iraq told the United Nations that the group goes through the phones of suspected homosexuals and targets their contacts. The UN estimated at that time that at least 30 executions of alleged homosexuals have taken place in IS-controlled territories. That number has certainly risen, given the subsequent IS videos and reports of LGBT executions in Iraq and Syria this year.

“Who is better than God in judgment – setting a limit on the people of Lot,” says one such video, before depicting the group shoving two suspected gay men off a rooftop in Homs, Syria.

In such filmed executions, IS makes multiple references to Quranic passages on Lot and the destruction of Sodom and Gomorrah, referring to the people of Lot as “criminals.”

“And we turned (the cities) upside down and rained upon them brimstone hard as clay,” says the Quran in verse 74 of the surah, or chapter, Al Hijr. Experts believe that IS’s gruesome executions are meant to symbolize God’s punishment of the cities, recreating the effect of being thrown into the air when the cities were flipped upside down.

However, there is no prescribed execution for homosexuality in the Quran or in Islamic law. Instead, scholars say, the Quran implies that retribution is in the hands of God. As for the hadith, the sayings attributed to the prophet Mohammad, there is much dispute as to whether he prescribed a particular punishment for sodomy.

“The schools of thought disagree about the punishment – some say they should be punished like adulterers, and then some distinguish between married men and unmarried men, married women and unmarried women,” said Youssef Qaradawi, a prominent televangelist and a spiritual leader of the Muslim Brotherhood movement, in an interview with Al Jazeera in June 2006.

“Some say both should be punished the same way, some say we should throw them from a high place, like God did with the people of Lot," he said. "The important thing is to treat this like a crime.”

Experts on jihadist movements say IS's campaign against gays is more than theological. It stems from their aim to exert control over every aspect of life – and instill fear.

“Just like punishing people for smoking, for drinking, for adultery, ISIS punishes people for the private life as a way of control,” says Hassan Abu Haniya, an Amman-based expert in jihadist movements.

Conservatives’ hit-list

It's not just IS which targets LGBT individuals. Mainstream Islamist groups have also long demonized the LGBT community in a bid to earn their credentials as “devout” and grounded in “family values.” And Middle Eastern governments, grounded in conservative social or tribal values, have often taken the lead in persecuting LGBT communities.

Iran, Saudi Arabia, Qatar, Yemen and the UAE all have various laws calling for the death penalty in certain instances of “homosexuality.” Mateen’s father’s homeland of Afghanistan also outlaws homosexuality, with the crime carrying a penalty of five to 15 years in prison.

Even in Egypt, President Abdul Fattah Sisi, who ousted Islamist president Mohammed Morsi in 2013 and brought back a more secular Egyptian regime, has persecuted the LGBT community, jailing dozens in so-called “morality raids,” even televising a nighttime raid on a bathhouse suspected as a frequent haunt for the gay community.

Yet opponents to criminalizing homosexuality can also be found across the spectrum of Islamists. In addition to the Saudi cleric Mr. Odah, Rached Ghannouchi, co-founder of Tunisia’s Islamist Nahda party, stated in an interview that the country’s law criminalizing homosexuality should be changed.

There have been no recorded executions for homosexuality in the Arab world over the past 30 years, but hundreds of jail sentences. Iran has executed several LGBT individuals in the past few years, while roaming militias in Iraq target suspected LGBT individuals in mass extra-judicial killings.

Get the Monitor Stories you care about delivered to your inbox. By signing up, you agree to our Privacy Policy

Rights activists say that governments' stigmatizing of sexual minorities has created an atmosphere that extremists are now exploiting in the name of religion.

“There is obviously a comparison to be made with an exclusionary ideology - exclusionary of sexual minorities – between these countries and ISIS,” says Adam Coogle, Middle East researcher for Human Rights Watch. But while those countries have court systems, albeit "deeply flawed" ones, he adds, "with ISIS, anyone can interpret and execute the law in their own hands at any time.”