A Doha court on Monday convicted a Dutch woman of adultery and handed her a one-year suspended sentence after she reported being raped while on holiday in Qatar.
The 22-year-old woman, known only as Laura and who was not in court, was also fined 3,000 Qatari riyals ($800/710 euros) and will be deported once she pays the fine, court officials said.
She had denied the charge against her.
The male defendant, said by a court official to be Syrian and named as Omar Abdullah al-Hasan, was sentenced to 100 lashes for the illicit sex and 40 lashes for consuming alcohol.
Hasan, who was also not in court, will undergo a medical examination to see if he is fit enough to withstand his punishment.
He will not serve any time in jail but will also be deported once he has been punished.
The Dutch ambassador to Qatar Yvette Burghgraef-van Eechoud, who was present in a packed courtroom, told reporters the embassy would help Laura leave Qatar.
"We will do everything to get her out of the country as soon as possible to where she wants to go," said Eechoud.
The envoy added that she expected Laura to leave Qatar, which will host the football World Cup in 2022, within the next few days.
The ambassador added that she had spoken to Laura yesterday and said that "under the circumstances she was doing fine".
Back in the Netherlands, Laura's mother said she had not yet spoken to her daughter but was "so happy" at the news of her release.
"I do not know yet when she gets home, but this is not most important," she told the Dutch television NOS website.
"The most important is that she gets home... I am so happy," she said.
Bert Koenders, the Dutch foreign minister tweeted that he was "relieved" that Laura could soon go home.
Laura was arrested on March 14 and has since been held in custody.
Her lawyer previously said that the incident happened after she had visited a Doha hotel.
"She went dancing but when she returned to the table after the first sip of her drink, she realised that" she had been drugged, Brian Lokollo has said.
"She really didn't feel very well," he added.
The young woman remembers nothing more until the following morning when she woke up in a totally unfamiliar apartment "and realised to her great horror, that she had been raped," he said.
The male defendant had insisted that their night together had been consensual and that the woman had even asked for money.
Adultery, or illicit sex, is treated as a serious crime in the conservative Gulf emirate.
But the case provoked an international outcry with many appalled by the treatment of an alleged rape victim and an online campaign using the #freelaura hashtag to try and draw attention to the Dutch woman's imprisonment.