Ask anyone in mainstream society, and they will gladly tell you: Islam is a homophobic faith. However, a quick walk down in memory lane tells us differently. What if someone told you that Prophet Muhammad had gays living in his house, that there was once a caliph who was openly gay, and that there were Muslims who decriminalized homosexuality before most of the rest of the world?

Of course, there are many who don’t like these facts, but, yes, Islam has not been as homophobic as some would like you to believe! Imagine, all these characters were just living their lives. Each one of them, however, in their own way, made an impact on today’s LGBT Muslims.

Let’s go through the times:

1. The Man Who Lived in the Prophet’s Home

Umm Salama, one of the wives of the Prophet, had an in-home male servant who was supposed to be gay but who proved to be otherwise. Faris Malik, an American researcher, says that the man “had been falsely assumed to be indifferent to women due to his being an ‘effeminate man’ [mukhannath]”. Needless to say, he was kicked out from the house. The story was reported in both Bukhari and Muslim authentic hadiths.

2. The Poet Who Angered the Masses

Abu Nuwas was a renowned entertainer who lived in the Islamic Golden Age. His father was Arab, and his mother was Persian. He blended the cultures, and wowed the Caliphs. According to American historian George E. Haggerty, Abu Nuwas was openly gay and his poems are full of homoerotic references to his lovers, the caliphs, and the men he desired during his lifetime. He was exiled by one caliph, and is believed to have been imprisoned by another, but he outlived most of his critics and has managed to keep himself in the history books.

3. The Caliph Who Ruled The Muslim World

During the same period as Abu Nuwas, there was also another gay Muslim who made history. Caliph Al-Amin, the son of Harun al-Rashid, led the Muslim World despite being openly gay. Muslim historian Al-Tabari wrote that he fell madly in love with one of his male slaves, Kauthar, whom he had named after a river in paradise. Imam Daayiee Abdullah, who is openly gay, says Al-Amin’s mother went to great lengths, including fashioning young women in the harem into men, in order to lure her son from his homosexuality. Of course, she failed.

4. The Lover Who Stole Rumi’s Heart

It was in the middle of the 13th Century when one day Rumi met Shams al-Din in a market in Konya, Turkey. It’s said their eyes met, and the two rarely separated after that. According to Keith Hale, an American scholar, Rumi and Shams would sometimes disappear into a room for months at a time, which led to jealousy among Rumi’s students and made them exile Shams at least twice. But, each time Rumi would be so heartbroken that they would allow the return of Shams to Konya.

5. The Vizier Who Changed the Law

Mustafa Reşid Pasha was the Grand Vizier of the Ottoman Empire not once but six times. Although he was married twice to women and had five children, it’s believed he was gay. Between 1840 and 1857, he championed for many reforms, including decriminalizing homosexuality, which the Caliph made legal in 1858. This made the Ottoman Empire the first powerful nation in the world to decriminalize homosexuality—over 100 years before the United Kingdom or the United States.

Afdhere Jama is the author of  Queer Jihad: LGBT Muslims on Coming Out, Activism, and the FaithHe lives in the United States.