A British woman held in Dubai for describing her ex-husband’s new wife as a horse on Facebook is to be allowed to go home.

Laleh Shahravesh, 55, was arrested with her 14-year-old daughter at Dubai airport in March, three years after she made the remarks on social media.

She was told she faced up to two years in jail and a fine of £50,000 for breaking Dubai’s cybercrime laws by posting insults online. Following a hearing on Thursday a judge has ordered Shahravesh to pay a fine of AED 3,000 (£625), and for her passport to be returned.

The Detained in Dubai campaign group, which has been helping Shahravesh, said her lawyer had paid the fine and that she should be home by early next week.

Shahravesh is said to have made the comments from the UK in 2016 when she saw photographs on Facebook revealing that her ex-husband had remarried in Dubai. She reportedly wrote in Persian: “I hope you go under the ground you idiot. Damn you. You left me for this horse.” Her ex-husband’s wife complained to the Dubai police.

Shahravesh and her daughter, Paris, were arrested at the airport when they arrived in the UAE last month to attend her ex-husband’s funeral. Both were bailed, with Paris allowed to return to the UK, while her mother awaited trial.

Radha Stirling, CEO of Detained in Dubai, said: “When cases like this are resolved either through the charges being dropped or through a governmental pardon, or the levelling of a light sentence after a concerted campaign in the international media, while the situation for the individual victim is over, the system that caused that victimisation remains in place, and abuse is inevitably going to occur again.”

She said cybercrime laws in the UAE were “a loaded gun pointed at the head of anyone using the internet” and added: “Anyone exercising their freedom of speech, who lives in, visits, or indeed, who may ever step foot in the UAE is at risk.

“We maintain that the case against Laleh should have been dismissed at the outset, and while we are pleased that her nightmare is over, her conviction on this absurd case sets a dangerous precedent.”