A prominent French LGBT activist was drugged, raped, beaten and held hostage for two days before risking his life to get free.

Zak Ostmane, 35, immigrated to France as a refugee three years ago after coming out as gay in Algeria – an offence punishable by two years in prison and a fine.

He co-founded the Shams-France group, which helps LGBT people from the Middle East who have come to the country to escape persecution.

On Friday, at a bar in Marseille, two men conspired to drug his beer while he was dancing and take him back to a hotel room, where they raped and beat him.

It was only on Sunday when he spotted a police car opposite the hotel that he was able to escape his horror after yelling to attract the officials’ attention.

Two alleged assailants have been identified and held in prison. Both used to be in the French Foreign Legion, but while one of the men left the legion after three decades, the other has been reported as a deserter.

Ostmane described the traumatising ordeal, which has left him afraid to go outside, to French LGBT blog Unicorn Booty.

After the men – whom he said were American and English – drugged him and led him to their room, “one of them went out and the other gave me a punch in the face, then sodomised me.

“The second man came back, sniffing coke. Then they asked me for money and took my credit card. I gave a false code, and they beat me again when I returned empty-handed.

“Then, still half-conscious, I remember that one of them tore a sheet and tied my ankles and wrists. I was kicked in the face and the chest.

“Then I was smashed against the wall and my nose was struck hard – there was blood everywhere.”

Terrified for his life, he tried to call for help from anyone who might be near the hotel room.

“I fell to the ground, I shouted with all my might, but one of the men took out a large knife. And he told me to be silent, otherwise he would going to kill me.”

He said that at some point in the next few hours, the American man had told him: “You French people…you hate Trump. And you listen to black and Arabic music. ”

Desperate for an escape route from a seemingly endless cycle of beatings and rape, Ostmane finally spotted one on Sunday.

“I saw through an open window a police car on the Place de l’Opera, with two policemen inside and one outside the car.”

He hesitated for a full 20 seconds, terrified by now of the consequences if he defied his captors again.

But eventually, he decided to act. “I thought: if I do nothing, I will die. So I shouted with all my strength.”

The two men beat him, but it worked. The police responded, running across the street, entering the hotel and quickly arresting the men.

Ostmane praised the officers, saying: “The policemen were very good with me – they took me to the hospital where I stayed from 1pm to 10pm on Sunday.”

Shams-France posted photos of Ostmane on its Facebook page, adding: “We strongly condemn this barbarous and abject act and give our full support to our dear friend.”