In Madrid for WorldPride 2017, one of the globe's biggest celebrations of LGBT rights, activists from the Muslim world called for greater freedom or the de-penalisation of homosexuality in countries where being gay is so frowned upon it can lead to jail.
In Tunisia, the fragile democracy ushered in after the 2010-2011 revolution against dictator Zine El Abidine Ben Ali has allowed for open debate on the situation of the country's LGBT community.
But homosexuality is nevertheless still punishable by three years in jail as per article 230 of the criminal code. Paradoxically, the country made abortion legal in 1973, ahead of France.
- Silence and control -
At a three-day gathering of more than 180 activists, Tunisian activist Hafedh Trifi said the "priority" was to abolish this article and the anal test used to see if someone had gay sex -- a practice he qualified as "inhuman" and "degrading."
He said the LGBT community had called for the repeal of this article ahead of elections in 2014, but was met by "silence from all parties."
In the Islamist Ennahda party that forms part of the ruling coalition, he added, some "say that it is an illness that must be treated, or that you have to kill, imprison or send homosexuals away into exile."
But it's not just about religion. In October 2015, Tunisia's President, the secular Beji Caid Essebsi, said on television that article 230 would not be repealed.
"I'm against it," he said.
In neighbouring Algeria, meanwhile, openly gay imam Ludovic-Mohamed Zahed says that "there is the impression that it isn't even possible to debate these issues."
Homosexuality there is also punished by jail -- as it is in Morocco and Libya -- and he says his country is in the hands of a "military-economic oligarchy" that fears diversity.
"If people live in a climate of diversity and debate, (the elite) will lose control, and it knows it," says this imam who has lived in France since the 1990s.
"It's easy to control a harmonised population."
- Beware of cliches -
Signup to our newsletter and follow us on Facebook and Twitter!
In Egypt, the fall of dictator Hosni Mubarak in 2011 did not free up the situation.
There, the law doesn't explicitly penalise homosexuality, but gay men are regularly jailed for "debauchery."
But in a talk on the LGBT community in the Islamic world, Muslim activist Daniel Ahmed Said warned against blanket-labelling Muslim countries as homophobic.
He said that in north Africa and the Middle East, French and British colonisations from the 19th century brought "rigid morals with regards to sexuality."
Trifi concurred, saying that laws against homosexuality in Tunisia came with the French protectorate, set up in 1881.
- Secular Turkey -
Further afield, the situation is particularly complex in Turkey, where secularity is one of the pillars of the modern republic proclaimed in 1923.
A first Gay Pride march took place in Istanbul in 2003. But authorities have banned it since 2015, citing security concerns.
This year, police fired rubber bullets at a small group of activists that tried to defy the ban.
Sedef Cakmak, an activist and councillor for Istanbul's Besiktas district, said the prohibition hides political and religious motives.
She told AFP that authorities in the secular country couldn't openly say that the 2015 ban was for Ramadan, but on the phone, she was told that it was due to the Muslim holy fasting month coinciding.
In 2014, the 35-year-old added, 80,000 people took part in Istanbul's Gay Pride march.
She said "the government saw that the LGBT movement is becoming a political actor in the country, so they started to see this as a threat."
Turkey is currently under a state of emergency implemented after a failed coup in July 2016 to unseat President Recep Tayyip Erdogan, and critics say their freedoms are not safeguarded.
Homosexuality is legal in Turkey, but on the other hand, Cakmak says, "there are no laws that forbid discrimination on sexual orientation and identity."
"So literally the state is saying 'we don't care about what happens to the LGBT community'."