A British tourist has been arrested and charged with illegal “extra-marital sex” in Dubai after she reported to the police that she had been gang raped.

The 25-year-old woman was on holiday in the United Arab Emirates when she was allegedly attacked by two British men, who have since flown back to England, The Independent reported on Wednesday.

According to law in the UAE, a woman, even if raped, would be arrested and the punishment could be a jail term, deportation, flogging and even stoning to death.

The UK-based Detained in Dubai campaign group said the woman has now been released on bail but her passport was confiscated and she cannot leave the country. The group is in contact with the woman’s family, who claim the two men had also filmed the attack at a hotel.

“They have taken her passport. She is staying with an English family but she is absolutely terrified,” a family friend told The Sun. “She went to the police as the victim of one of the worst ordeals imaginable but she is being treated as the criminal.”

Radha Stirling, the founder and director of Detained in Dubai, told The Independent that the case was a “tremendously disturbing “ example of long-running abuses in Dubai. “Police regularly fail to differentiate between consensual intercourse and violent rape. Victims go to them expecting justice, and end up being prosecuted.  They not only invalidate their victimization, they actually punish them for it,” she said.

A spokesperson for the Foreign and Commonwealth Office told The Independent, it was aware of the case and was providing support to the woman and her relatives, as well as remaining in contact with local authorities.

Hundreds of women, some of them pregnant or domestic servants who are victims of rape, are imprisoned in the UAE every year under laws that outlaw consensual sex outside marriage.

Secret footage obtained by the BBC Arabic recently  showed pregnant women shackled in chains walking into courtrooms where they were being tried under laws prohibiting “Zina” – or sex outside marriage.

“Because the UAE authorities have not clarified what they mean by indecency, the judges can use their culture and customs and Sharia ultimately to broaden out that definition and convict people for illicit sexual relations or even acts of public affection,” Rothna Begum, women’s rights researcher at Human Rights Watch in London, told The Guardian.

Even in the past there have been cases involving foreigners falling foul of the law. In 2010 a British woman who made a rape complaint against a waiter in Dubai was arrested for “having illegal sex with her fiancé. A Norwegian woman, who reported being raped by her colleague, was imprisoned for extra marital sex and was only released after international outcry.