A British woman who faced prison in Dubai for calling her ex-husband's new wife a "horse" on Facebook has been released, the campaign group which represents her has said.
Laleh Shahravesh, 55, was arrested at a Dubai airport after flying to the city to attend her ex-husband's funeral.
The Detained in Dubai group said the case had been settled with a AED3,000 (£625) fine after a hearing.
Ms Shahravesh is expected to be home by next week, it added in a statement.
The mother-of-one, from Richmond in south-west London, was married to her Portuguese husband Pedro for 18 years.
The couple lived together in Dubai for eight months - where Pedro worked for HSBC - before Ms Shahravesh returned alone to the UK with the couple's daughter.
In 2016, she received divorce papers and discovered on Facebook that Pedro was remarrying.
Writing in Farsi on Facebook, Ms Shahravesh said: "I hope you go under the ground you idiot. Damn you. You left me for this horse."
In another post, she wrote: "You married a horse you idiot."
Ms Shahravesh was arrested in Dubai, part of the United Arab Emirates (UAE), on 10 March after travelling there for Pedro's funeral following his death from a heart attack at the age of 51.
Under the UAE's cyber-crime laws, a person can be jailed or fined for making defamatory statements on social media.
Detained in Dubai said Ms Shahravesh's ex-husband's new wife, who lives in Dubai, had reported the comments.
Following a hearing on Thursday, the group said Ms Shahravesh's passport had been returned to her.
Its chief executive Radha Stirling described the fine as "symbolic", adding that the UAE's cyber laws were "a loaded gun pointed at the head of anyone using the internet".
BREAKING: #FreeLaleh told she will be home by early week. Her case has been settled by payment of a AED3,000 fine to @DubaiCourts. An application has been made for the return of her passport & her lawyer has advised she will be home with her daughter early next week.— Radha Stirling - CEO @detainedindubai 🇺🇸🇦🇺🇬🇧 (@RadhaStirling) April 11, 2019
She added: "Laws are supposed to protect people, protect their rights and freedoms, but the UAE's cybercrime laws do the opposite.
"Everyone travelling to or through the UAE is endangered by them, and not everyone who falls victim to these laws is guaranteed media coverage. In the absence of international support, they will be subjected to the full force of the law.
"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."