Ludovic-Mohamed Zahed was born in Algeria in 1977 and moved to Paris as a child.
He told The Local about his difficult upbringing in a religious family.
"I was an effeminate child and that is not seen as a good thing in men so I had to make myself more masculine," he said.
"At first my father thought it was an illness, then he thought it was just a phase."
He suffered physical as well as verbal abuse.
"My brother often beat me up, so it was quite violent and complicated."
His experiences forced him to question his identity and his religion.
In his new book, The Koran and The Flesh (Le Coran et la Chair), Zahed recounts in detail the story of growing up as a gay Muslim.
"It started as a personal diary," he said. "Eventually it grew to become a book."
In the book he traces the journey that helped him reconcile his sexuality and his religious beliefs.
"At age 18, when I finally accepted being gay, I felt I had to choose between my sexuality and Islam. I didn't understand at the time that there are different types of Islam."
In his confusion he turned away from his faith for ten years.
"It was traumatising for me. I couldn't really understand how homosexuality could be so violently rejected despite the fact I had done nothing wrong and was trying to live a good life."
"Eventually, I realised there was a big hole in my life so I investigated buddhism, but discovered there are also buddhists who are homophobic."
Zahed then decided to return to Islam and to explore its teachings in more depth.
His research led him to believe that homosexuality and Islam are compatible.
"There is nothing about homosexuality that 'goes against nature' according to one interpretation of Islam. Quite the opposite," he argues in his book.
He says there are many associations supporting gay Muslims and that English-speaking countries tend to be more advanced.
Zahed is now completing a doctorate on the subject of Islam and homosexuality at Paris' prestigious School for Advanced Studies in the Social Sciences.
During his studies Zahed found personal happiness when he met his partner.
Qiyaammudeen Jantjies-Zahed, also a Muslim, met Zahed at a conference in South Africa in 2011.
The couple decided to get married in South Africa, where same sex marriage is legal.
Back in France, where the couple now live, the marriage is not recognised as France has a ban on same sex marriages.
Gay marriage has become an issue in the current French presidential campaign, with Socialist candidate François Hollande promising to introduce it while current president Nicolas Sarkozy is firmly against.
Zahed believes that some parts of the political class needs to catch up with French society on the issue.
"There have been MPs who have said that if we allow same sex marriage, why not marriage with animals or paedophilia," he said. "The political class can be very conservative. Normal society evolves much more quickly than politicians."
The couple had a religious ceremony in February to celebrate their marriage in the Parisian suburb of Sevres.
On the whole, they received positive responses to the event, although inevitably there were negative reactions as well.
His family is now fully supportive of him and his marriage.
"After a few years my mother told me they understood and that my sexuality was normal and a part of nature. They just wanted me to be happy and to meet someone."
Zahed plans to continue his struggle to convince others that homosexuality and Islam are compatible.
He thinks that the prophet Muhammad, if he were alive today, would support same sex marriage.
"He defended men who were effeminate and who were not attracted to women. He banned any violence against them," said Zahed.
"He was a believer in social justice and a revolutionary, like all prophets. Giving the same rights to homosexuals and opening marriage to everyone is a part of social justice."