Moroccan journalist Hajar Raissouni who was sentenced to one year in jail for an "illegal abortion" and sexual relations outside marriage walked free on Wednesday, an AFP photographer said, hours after being granted a royal pardon.
In a case that provoked a storm of protests from rights groups, the justice ministry said the 28-year-old woman was released on a pardon issued by King Mohammed VI.
Rassiouni was sentenced on September 30, along with her Sudanese fiance, a gynaecologist, anaesthetist and a medical assistant, whose convictions were also overturned, an official told AFP.
The ministry said the monarch wanted to help "preserve the future of the couple, who wanted to establish a family in line with our religious and legal precepts, despite the error they made".
The journalist works for Arabic-language newspaper Akhbar Al-Yaoum, which has a history of run-ins with the authorities.
Raissouni was arrested on August 31 as she left a clinic in Rabat. In court, she denied having had an abortion, saying she had been treated for internal bleeding -- testimony backed up by her gynaecologist.
She was sentenced under Article 490 of the legal code of the Muslim kingdom.
That article punishes sexual relations out of wedlock, while the law also forbids all abortions unless the mother's life is in danger.
The journalist denounced the affair as a "political trial", saying she had been questioned by police about her family and her own writing.
In a case that sparked widespread debate on personal and media freedoms in Morocco, her gynaecologist, who spoke up in her defence, was given two years and her Sudanese fiance one year in prison.
An anaesthetist was handed a one-year suspended sentence and a medical assistant eight months, also suspended.
Rights groups were quick to condemn the verdicts, with Amnesty International describing them as a "devastating blow for women's rights in Morocco".
Ahmed Benchemsi, the regional director for Human Rights Watch, described the sentencing of Raissouni and her fiance as a "black day for freedom in Morocco".
The verdicts were "a blatant injustice, a flagrant violation of human rights, and a frontal attack on individual freedoms," he wrote on Twitter.
The prosecution insisted she had been seen by a medic and showed signs of pregnancy and of having undergone a "late voluntary abortion".
It had contended her detention had "nothing to do with her profession as a journalist".
Between 600 and 800 back-shop abortions occur each day in Morocco, according to estimates by campaign groups.
In a manifesto published on September 23 by Moroccan media outlets, hundreds of women declared themselves "outlaws" by claiming to have already violated the "obsolete" laws of their country on abortion and other social norms.
In the early 1970s, in a similar text, French women calling themselves the "343 sluts" famously declared they had had an abortion when it was still illegal.
Last year, Morocco tried thousands of people for sex out of wedlock, 170 people for being gay and 73 for pregnancy terminations.