In the early hours of Sunday morning, as news came through about the massacre in Orlando, I was at a bar with some friends. We were a group of Muslims, Hindus, and Jews, atheists and agnostics, straights and gays, doing more or less what the innocent young men and women at Pulse night club were doing before they were mowed down by bullets. The moment it became known that the Orlando killer was a Muslim, and that this was both a hate crime and an act of terrorism, I immediately went rigid. He would have killed all of us if he were here, I thought, and he could have started with me.

The facts are still being pieced together from Orlando, but some things are now clear: Omar Mateen was a disturbed Muslim with mental health issues; he had bought his assault rifle legally; he was twice interviewed by the FBI; he was a drinker and an abusive husband; he had called the police department before the carnage and pledged allegiance to ISIS. Most surprisingly for a radicalized fanatic, he had once stated a buffoonish affinity for both al Qaeda and Hezbollah, thus putting himself on both sides of the war between Sunni and Shiite extremists. In most respects, the Orlando killer fits the same profile as other lone-wolf attackers: a distressed loud-mouth seeking religiously sanctified revenge for alleged crimes he knows nothing about and on behalf of people he has never met. What is different this time is that the killer’s target was a venue where gay people congregated. A dose of homophobia was added to the usual mix of religious fanaticism and self-loathing—a particularly potent dose, it appears, because it turns out the killer may have been gay himself and had visited Pulse at least a dozen times before.

As expected, the loudest screams on social media following the attack were from people either condemning Islam or condemning Islamophobia, but both the anti-Islam crowd and the anti-Islamophobia crowd generally treated the homophobic element of the crime as an afterthought. The Christian right and the New Atheists tend to focus on Islam to the exclusion of other issues—ask them about the white gunman who was arrested with explosives en route to the Los Angeles Pride Parade the same day, and you might get a shrug. Meanwhile, those on the anti-racist left usually refrain from criticizing non-white culture, because they see themselves as the embattled defenders of pluralistic liberalism. Yet after the gay community was specifically and brutally targeted, far too many Muslim activists and leaders were silent on the homophobia within the Islamic community. The prominent scholar Yasir Qadhi claimed that “the guy was mental, plain and simple” and that “Islam’s stance on homosexuality is IRRELEVANT to this massacre, period.” This would be like saying racism was irrelevant in the shooting of a black church in Charleston, South Carolina, last summer.

The LGBTQ community has been attacked by a man whose civil rights and whose faith would have been fiercely protected by liberals. Pressing questions need to be asked. The most important of these is whether Islamic culture, or Middle Eastern and Central-South Asian social mores—the major assumptions upon which Mateen based his life—were themselves discriminatory and hateful towards gays. It is time to ask whether such attitudes were the mental fingers on the trigger long before the dreadful morning of June 12, 2016.

Growing up, I attended Koran classes in Toronto every day between the age of 6 and 16. I have traveled around the world and discussed Islam in Geneva, Jordan, Jerusalem, Iraq, and Turkey. I harbor no resentments towards Islam, and despite my current agnosticism, I still call myself a Muslim because the world of Islam has been an integral part of my identity for my entire life. I confess that when discussing Islam with white people, the writer in me tussles with the spokesman who seems to overtake the wheel of my mind, responsibly steering the conversation away from moral gray areas. The offer to become an informant on one’s culture will be familiar to any minority writer, as well as the guilt that comes with confirming a white person’s presumptions that a non-white culture may be inferior. The native informant trap is all too real for any non-white writer and must be avoided; it is doubly real for Muslims who can easily cash in by criticizing their own kind.

With all of that being said, the Orlando killer was a Muslim, and so it is worth stating this in the clearest possible terms: A large swath of the Muslim-majority world has a serious problem with gays. No, Islam does not have a monopoly on homophobia. Countries like Jamaica, Honduras, Uganda, Russia, and China have all passed anti-gay legislation. In America, Lawrence v. Texas, the pivotal Supreme Court Case that struck down the ban on homosexual sex, was decided just 13 years ago, in a 6-3 vote. Both Barack Obama and Hillary Clinton opposed same-sex marriage in 2008. During the AIDS epidemic in the 1980s, gays were evicted from their houses, fired from their jobs, and turned away from hospitals. Even after they had left this earth, their dead bodies were rejected by funeral homes. The great Martin Luther King thought homosexuality was a mental illness, which is probably why the great James Baldwin never spoke at the March on Washington.

Still, there is no getting around the truth that homophobia is rampant in the Muslim world. It is clerically justified and socially defended. Fifty-one states constitute the Organization of Islamic Cooperation (OIC), and ten of them punish homosexual activity with the death penalty, including Afghanistan, where the Orlando killer traced his roots. Nearly all the others have criminalized homosexuality with sentences ranging from one month to life in prison. Gays and lesbians are viewed as demonically inverting nature, as sinners, freaks, deviants, corrupters, insurrectionists, miscreants. Their sexual orientation shames whole families into denouncing them. They live in perpetual fear and perpetual hiding.

The homophobic old men who run Muslim governments are not even content in enforcing outdated morality codes within their own borders. This past May, the OIC blocked eleven gay and transgender organizations from attending a high-level United Nations meeting. The agenda for that meeting was ending AIDS.

Even among far too many Muslims in the West—especially young Muslim males—homophobia takes on either a passive, silent form or an aggressive, vociferous one. In all those years in Koran classes, there was no end to the round-bellied mullahs opining on the Jews or the gays as we children unthinkingly nodded along. The word “faggot” was used as a routine epithet in our vocabulary, a stand-in insult for anything—what did it matter what the Koran said about swearing? Even as an adult, I have found myself time and again in conversations with young Pakistani or Indian or Afghan or Iraqi or Somali men (women tend to be more open-minded), and have heard such grotesquely homophobic comments in such casual tones that it was clear that homophobia was encoded in their—our—brains. I recall one such conversation from a few summers ago when a young Muslim man my age justified the stoning of gays because he said it was in the Koran. When I pressed him on whether he would stone gays himself, he said no, because the Koran stipulated four witnesses to the act and so corporal punishment for gays would never be a concern. (The Koran actually says nothing about stoning gays.) If you are a Muslim and think I am exaggerating about Muslim attitudes towards gays, walk into your local mosque this Friday and inform the imam that you are gay and watch his response. A shield of white liberal guilt protects socially conservative minorities from having their positions challenged, and this shield is harmful—it turns the intellectual space into a cultural ghetto where stale ideas become barriers impermeable to dissent and diversity.

Such attitudes are informed both by the Koran and cultural practices that people assume have been common for centuries. The Koran echoes the Torah in retelling the story of Lot and how sodomy brought Allah’s wrath down on Lot’s people, though the overlooked detail here is that the people of Lot were not simply homosexuals; they were homosexual rapists. As with any religious text, the Koran is contradictory and ambiguous and the reader cannot approach it in isolation. Just as the U.S. Constitution must be interpreted with an appreciation for what the original text meant, how jurisprudence developed over the years, and what conclusions jurists and legal scholars drew from its principles, the Koran must be read in light of all of Islamic history. There are historically informed readings and historically ignorant ones, and ISIS, the Orlando killer, and the Muslims who justify homophobia with recourse to a seventh-century text all eliminate 1,400 years of history, commentary, discussion, rebuttal, and consensus.

The ideology that freezes Islam in the seventh century is known as Salafism. It is the official state-sanctioned ideology of Saudi Arabia, as well as ISIS. Founded in the seventeenth century, Salafism was once something of a fringe joke because of the extremes of its puritanism. Shiites not being Muslims? Women forced to wear black shrouds? Insufficiently devout Muslims apostatized and murdered? Gays and adulterers given the death penalty? Salafism’s fatal combination of retrograde thinking, reactionary dictates, and revolutionary violence is the very essence of fascism. The ideology went mainstream in the 1970s when the Saudis began pumping oil money into exporting Salafism abroad. They knew full well that to control human beings you must first control their minds, and four decades later, Salafism is the dominant strain of Islam in many parts of the world.

It is ironic that fundamentalist conservatism pervades the Islamic world, for the Prophet Muhammad was anything but a conservative, upending the social order of Arabia during his time. His core ideas—unity for all people, no distinctions between race or class, spiritual enlightenment through bodily cleansing, divorce and inheritance rights for women, mandatory redistribution of wealth from rich to poor—were all radically egalitarian propositions for his age. A spirit of fearless dissent is what allowed Muhammad to challenge the Meccan elites who wanted to kill him for uttering such blasphemies. The Arabs being a literary people, Muhammad’s weapons were his words. The first miracle of Islam is that an illiterate man is able to read. The first revelation is an instruction to recite. The second Koranic chapter is titled “The Pen.” Intellectual evolution and revolution are inherent in Islam. Moral stagnation is not.

Despite all the efforts of Muslim despots to scrub gays from the historical record, Islamic history is not only rife with gays in the public arena, but boasts a vast corpus of literature and poetry that celebrates their love. The eighth-century poet Abu Nawas, considered one of the greatest Muslim poets, a man who influenced both Omar Khayyam and Hafiz, wrote multiple verses devoted to homoerotic love.

I die for him, perfect in every way
Lost in the strains of wafting music
My eyes are fixed upon his delightful body
And I do not wonder at his beauty.

These are the opening lines from one of Abu Nawas’s works. Rumi and his spiritual instructor Shams-i-Tabrizi were more than just passing friends and their enchanting first encounter and the joint seclusion it inspired are part of the folklore of Middle Eastern literature. In 1858, the Ottoman Empire decriminalized homosexuality. These were not one-off instances, either, as the Encyclopedia of Islam and the Muslim World notes:

Whatever the legal strictures on sexual activity, the positive expression of male homoerotic sentiment in literature was accepted, and assiduously cultivated, from the late eighth century until modern times. … Anecdotal literature reinforces this impression of general societal acceptance of the public celebration of male-male love.

Vicious homophobia among too many Muslims cannot be conveniently attributed to the Koran. The core reason homophobia is rampant in the Islamic world, and the reason many Muslims in the West instinctively denounce Islamophobia while remaining silent on homophobia, is because from a young age, Muslim children are taught that sexual feelings are impermissible. A basic ignorance envelops the sexual life of the Muslim child—her parents will never mention sex other than to condemn it; her god is apparently opposed to all forms of sexual temptation; her mosque teaches that sexual impulses are the devil’s work. Humans are sexual beings, and if sexual feeling is considered sinful by the state, the family, the mosque, and the community, the child who begins to think he is different from the other boys will be tormented by self-hatred. He will either reject his religion or reject his body—and the latter can easily lead to frustration and violence.

A conservative orthodoxy that attempts to repress sexuality actually does the opposite: It repurposes and channels sexual feelings into perverted ends. In Pakistan, the Council of Islamic Ideology defends the practice of old men marrying young girls—a form of legalized, institutionalized rape. In Dubai, women are to dress modestly and Islamic codes are to be publicly observed, but in private, Saudi princes have cocaine-fueled orgies in seven-star hotels. Perhaps the worst case of gross hypocrisy takes place in Afghanistan, where because women cannot dance in public and because Afghan social mores are ultraconservative, a practice known as bacha bazi, or “boy play,” is common. Young boys are dressed up as girls, sometimes with fake breasts, and they dance for crowds of old men who drug and rape them. It is an organized form of pedophilia that American soldiers were shamefully told not to bother looking into.

Hatred of sexuality makes old men across Asia and Africa mutilate the genitalia of little girls; fear of sexual autonomy leads patriarchs in Afghanistan and Pakistan, in the name of preserving family honor, to murder their daughters and sisters who marry of their own accord—because honor is thought to repose in a woman’s vagina. If you are a woman or gay, the last place on earth you would want to be born is the Gulf region, whole swaths of the Middle East and Africa, or the rural areas of Afghanistan and Pakistan.

Sexual repression breeds maniacal obsessions. The old men who spend all their waking moments trying to veil women are themselves responding to the self-hatred that comes from self-abnegation. The young men who are tormented by the thought that two gay people might be in love somewhere are, in fact, bedeviled by the belief deep in their hearts that others are free but they themselves are chained to an antiquated morality. Something has gone terribly wrong in the mental and sexual life of a culture—once rich in diversity—when it is hijacked by a conservative puritanism that is autocratically enforced by repressed men.

Laws that are both impossible to follow and impossible not to break create a terrorizing bipolarity in the minds of individuals and the societies they inhabit. Such customs are passed on from generation to generation, abetted by an elaborate facade of traditional purity. These facades are exposed the moment they are challenged, but challenging them comes with consequences, often fatal. Thus, many Muslim families in the West still practice first-cousin marriage despite the many health risks this carries. In what twisted morality is dating bad but borderline incest ok? Homosexuality sinful but grandfathers marrying teenage girls virtuous?

The fact that a gay bar was attacked by a Muslim man is not to be brushed aside or understated—it is the unconscionable but predictable consequence of a deep-seated homophobia. Which brings me back to the alleged homosexuality of the Orlando killer. His sexual orientation is not a laughing matter, nor is the Muslim-majority world’s attitudes towards gays “irrelevant,” as Yasir Qadhi said. Mateem’s sexual orientation and what Islamic culture says about homosexuality are central to this massacre. The killer’s unrelenting homophobia was a lethal synthesis of what he knew was true about himself and what he knew his fellow Muslims thought of gays. He appears to have been rejecting his own homosexual impulses, which are as natural as heterosexual impulses. His father was himself ruthlessly homophobic. Mateem was afraid of his god, of what his family would say, of how his culture would condemn him, and so his visceral shame became visceral hatred.

Muslim leaders have repeatedly been silent on the sufferings of LGBTQ individuals. They have treated them as though they were unworthy of god’s love. But in debasing gays, Islam’s homophobes have only debased themselves. The battle for civil rights and for dignity will never be won, peace in the Muslim-majority world will never be won, freedom of thought and conscience will never be won, until and unless a sexual revolution accompanies an intellectual one.