ISTANBUL -- As shocking as the attack in Orlando is, violence against the LGBT community is common -- even sanctioned -- in some parts of the world.

Some Islamic countries impose the death penalty for homosexuality. But none compare to the depravity of ISIS.

An ISIS propaganda video shows a presumed gay man being led to a rooftop.

In their propaganda videos, men accused of having sex with other men are executed in typically barbaric fashion.

And it's not just under ISIS that gay and lesbian people face the death penalty.

Same-sex sexual relations are illegal in more than 70 countries, but only in seven predominantly Muslim states can you be sentenced to death for it.

Ramtin Ebrahimipour told us he fled Iran last year after spending three months in prison for handing out leaflets against homophobia.

"They beat me, they tried to suffocate me with a pillow, and they stuck their shoes in my mouth."

Not all Muslim societies are intolerant of homosexuality.

In Turkey, which is majority Muslim, gay sex was legalized in 1858. That's nearly 150 years before it finally became legal in all American states.

Both the Koran and the Bible condemn homosexuality, according to some interpretations.

But as the West has become more tolerant when it comes to sexuality, it has sparked a culture clash with many conservative Muslims.

The massacre in Orlando has been praised by ISIS and the group's supporters in the Middle East. But at this point there's no indication that the group had any contact with the shooter.