A US man in Thailand who was arrested for writing a negative hotel review will avoid legal action and jail time.
Wesley Barnes had posted several reviews allegedly accusing the Sea View Resort of "modern day slavery".
He was subsequently detained and charged under Thailand's strict anti-defamation laws.
Police said Mr Barnes and the resort had managed to reach an agreement, which included an apology to the hotel and to Thailand's tourism authority.
He was also told to send a statement to foreign media organisations that had previously written about his then possible arrest, including BBC News.
In it, Mr Barnes said that he apologised for his "repeatedly false and untrue statements... made to maliciously defame Sea View. These reviews were written out of anger and malice".
The statement said he regretted his actions, adding that "the hotel has forgiven me and agreed to withdraw the complaint".
Colonel Kitti Maleehuan, superintendent of the Koh Chang police station - the island where the resort is located - told the AFP news agency that both parties had met over a mediation session overseen by police.
Mr Barnes will also have to provide "an explanation to the US embassy", said AFP - though it did not elaborate.
The hotel had said it would withdraw its complaint against Mr Barnes if he met all these terms.
Mr Barnes had ahead of the mediation session told news agency Reuters that he wanted to "end this case once and for all".
If found guilty, he could have faced up to two years in prison.
'Fabricated, recurrent and malicious'
Mr Barnes, who works in Thailand, had stayed in the Sea View resort earlier this year.
He is said to have got into an argument with staff over him wanting to bring his own bottle of alcohol while dining in the restaurant.
A hotel statement said he had "caused a commotion" and refused to pay a corkage fee which was eventually waived when the manager intervened.
Since leaving, Mr Barnes posted several negative reviews of the property, after which the hotel sued him for defamation.
The hotel has alleged that his reviews were "fabricated, recurrent, and malicious", with one post on TripAdvisor accusing the hotel of "modern day slavery".
Mr Barnes, though, had earlier told the BBC that this particular post was never published as it violated TripAdvisor's guidelines.
He also said he had already lost his job over the incident and expressed worries that the publicity his case had received would make it harder to find new employment.
The hotel told the BBC that after the reviews had been published, it had received cancellations and inquiries about employee treatment.
Thailand's tourism sector has been hit hard by the fallout of the global coronavirus pandemic.
"Receiving multiple false and defamatory reviews over a period can be extremely damaging, especially, during these incredibly difficult times," the statement from the hotel said.
They added that they had repeatedly tried to contact Mr Barnes before they filed the suit.
"We chose to file a complaint to serve as a deterrent, as we understood he may continue to write negative reviews week after week for the foreseeable future," they said.
"Despite our multiple efforts to contact him to resolve the matter in an amicable way for well over a month, he chose to ignore us completely. He only replied to us when he had been notified of our complaint by the authorities."