(RNS) As one of a tiny number of openly gay imams in the world, Daayiee Abdullah has felt the sting of rebuke from fellow Muslims. No good Muslim can be gay, they say. And traditional schools of Islamic law consider homosexuality a grave sin.
But Abdullah, a Washington, D.C. lawyer who studied Islam in the Middle East, says that mainstream Islamic teaching on gays must change.
“It has to or it will die from its harshness or rigidity,” Abdullah said. “The way it is presently understood, it rots the heart and decays the brain.”
In the days since last’s week massacre at an Orlando gay nightclub, in which a Muslim man killed 49 people, attention has focused on homophobia among Muslims. And gay Muslims have talked about living between that rock of anti-gay anger and the hard place of Islamophobia that only increased after the Orlando attacks.
Investigators are considering whether Omar Mateen was at least partially motivated by his inability to accept that he was gay. Mateen's father said his son was disgusted by two men he saw kissing days before the rampage, and that it was up to God to deal with gays -- not his son.
Yet attitudes towards LBGT people in Muslim communities are complex, and far from universally anti-gay.
Some Muslims, like Abdullah, are welcoming what they see as an opening within their communities to address anti-gay attitudes. Several groups supportive of gay Muslims have sprung up within the U.S. in past years, including Muslims for Progressive Values and the Muslim Alliance for Sexual and Gender Diversity.
And young Muslims who often feel differently about homosexuality than their elders are increasingly speaking out in support of gay rights, as religion scholar Reza Aslan and comedian Hasan Minaj did in an open letter to American Muslims after last year's Supreme Court decision legalizing gay marriage.
Others are pointing toward the Quran and a history of relative tolerance.
“In 1858 the Ottoman Empire decriminalized homosexuality, 100 years before they did so in the West,” said Abdullah, referring to the empire that ruled over Turkey and much of the present-day Middle East in the 15th and 16th centuries. Its official religion was Islam.
But Abdullah is under no illusions about the strength of homophobia within modern Muslim cultures.
In the U.S., a 2014 Pew Research Center study shows, Muslim Americans are less accepting of homosexuality than Americans as a whole: 47 percent of U.S. Muslims said it should be discouraged and 45 percent said it should be accepted.
But they were not the religious group that was most disapproving: Evangelical Christians, Jehovah's Witnesses and Mormons oppose homosexuality by larger margins.
Abroad the picture is starker. And a 2013 Pew global study of Muslims showed overwhelming disapproval of homosexuality. In only three of the nearly 40 countries surveyed do as many as one-in-ten Muslims say that homosexuality is morally acceptable: Uganda (12 percent), Mozambique (11 percent) and Bangladesh (10 percent).
And almost all of the 10 countries that allow the death penalty for same-sex sexual relations are Muslim-majority nations. The president of one of those nations, Iran, has denied that gay people exist in his country.
"In Iran we don't have homosexuals like in your country," Iranian President Mahmoud Ahmadinejad said at Columbia University in 2007. “ I do not know who has told you we have it.”
The gay capital of the Middle East is in the Jewish state of Israel: Tel Aviv advertises itself as a safe, vibrant destination for LGBT tourists, and attracts gays from the Palestinian territories and other societies where it is unthinkable to be openly gay. But even in Israel, a Jewish teenage girl died after an ultra-Orthodox Jewish man went on a stabbing spree last year at Jerusalem's gay pride parade.
While Muslim nations such as Iran and Saudi Arabia have legislated violent punishment for gays, there are no laws against gay sex in either Jordan and Lebanon. You can find gay-friendly bars in Beirut, Amman and Istanbul.
And because socialization between unmarried men and women is unacceptable in conservative Muslim society, same-sex social gatherings are the norm, and may present opportunities for gay people to follow their hearts, Abdullah said.
That doesn’t mean that gays don't suffer beatings and worse in these somewhat more tolerant countries, or that their families accept them. But even in places like Egypt, where the government has jailed and tortured its gay citizens, some LGBT people are still organizing, carefully, to improve their situations.
Those Muslims who reject gay relationships often point to sacred writings, as is the case with like-minded Christians.
For example, Adbdullah has often heard Muslims invoke the story of Lut in the Quran (comparable to the story of Lot in the Bible) to argue that Islam condemns men who love men. Like many other gay Muslims, he reads the same verses and comes to a different conclusion: that the story condemns cruelty, not any particular sexual act.
In the Quran, he finds nothing to condemn his sexual orientation. The word "homosexuality" is not used in the text, he notes. "The Prophet was not prejudiced."
Pointing to the Quran or any religion's sacred writings to explain current day moral stances also makes little sense, said Aisha Geissinger, who teaches about Islam at Ottawa's Carleton University.
"Nobody takes all of their sexual morality nowadays from an old text. Christians don't do it. Muslims don't do it," Geissinger said. "Otherwise, we’d have slavery."
And like Abdullah, she offers an example from history that counters the idea that Muslim societies are monolithic and have always been hostile to same-sex desires.
In "Before Homosexuality in the Arab-Islamic World, 1500-1800," author Khaled El-Rouayheb points out that much of the poetry in the Arab world prior to the 19th century was written by men about a male beloved, or a person whose gender is ambiguous.
"It is difficult to imagine that this type of poetry was so popular if it didn’t reflect something about what people were seeing as normative," Geissinger said.