REYHANLI, Turkey - Before a crowd of men on a street in the Syrian city of Palmyra, the masked Islamic State group judge read out the sentence against the two men convicted of homosexuality: They would be thrown to their deaths from the roof of the nearby Wael Hotel.

He asked one of the men if he was satisfied with the sentence. Death, the judge told him, would help cleanse him of his sin.

"I'd prefer it if you shoot me in the head," Hawas Mallah, 32, replied helplessly. The second man, Mohammed Salameh, 21, pleaded for a chance to repent, promising never to have sex with a man again, according to a witness among the onlookers that July morning who gave the Associated Press a rare firsthand account.

"Take them and throw them off," the judge ordered. Other masked extremists tied the men's hands behind their backs and blindfolded them. They led them to the roof of the four-story hotel, according to the witness, who spoke in the Turkish city of Reyhanli on condition he be identified only by his first name, Omar, for fear of reprisals.

Dangled and dropped

Notorious for their gruesome methods of killing, the Islamic State group reserves one of its most brutal for suspected homosexuals. Videos it has released show masked militants dangling men over the precipices of buildings by their legs to drop them head-first or tossing them over the edge. At least 36 men in Syria and Iraq have been killed by IS militants on charges of sodomy, according to the New York-based OutRight Action International, though its Middle East and North Africa coordinator, Hossein Alizadeh, said it was not possible to confirm the sexual orientation of the victims.

The fear of a horrific death among gay men under Islamic State rule is further compounded by their isolation in a deeply conservative society that largely shuns them.

Many Muslims consider homosexuality to be sinful. Gay men are haunted constantly by the possibility that someone, perhaps even a relative, will betray them to the militants - whether to curry favor with IS or simply out of hatred for their sexual orientation. Islamic State fighters sometimes torture suspected homosexuals to reveal their friends' names and search their laptops and mobile phones. Even among IS opponents, gays find little sympathy. Some in the public who might be shocked by other IS atrocities say killings of gays is justified. Syrian rebel factions have killed or abused gays as well.

Fearing father

Subhi Nahas, 28, a gay Syrian who now lives in San Francisco, said he fled because he feared his own father might turn him in to al-Qaeda's affiliate, the Nusra Front, which also has targeted homosexuals.

When his father learned he was gay, Nahas said, he called him a shame to the family and beat him. Around the same time, in late 2013, Nusra fighters launched a crackdown on suspected gays in Nahas' hometown of Maaret al-Numan, detaining 25 men and announcing through mosque loudspeakers that they would cleanse the town of homosexuals.

"With the problems between me and my father, I did not rule out that he might [hand me over]," he told the AP.

So he fled, first to Lebanon, then Turkey. But in Turkey, he said, he began getting death threats from a former school friend who joined IS. Fearful that he wouldn't be safe even in Turkey, he legally resettled to the United States in June.

In August, Nahas and a gay Iraqi man spoke about the suffering of homosexuals in their countries at the first-ever U.N. Security Council session spotlighting violence and discrimination against lesbians, gays, bisexuals, and transgender people.