Afghanistan has pardoned a woman who was raped by a family member but then jailed for adultery, a statement from the presidential palace has said, in a case that highlights deep concerns about women's rights in the country.
The 21-year-old, known as Gulnaz, had earlier been offered release from prison if she married her attacker and eventually agreed to this condition, but her lawyer said the release granted this week did not depend on her going through with the wedding.
It was not clear whether she still intended to marry the man who raped her, her cousin's husband, who is serving a seven-year prison term for the crime, her lawyer Kimberley Motley added.
Afghan president Hamid Karzai's palace issued the statement pardoning Gulnaz late on Thursday, a rare pardon in such a case in staunchly conservative Muslim Afghanistan.
Her case attracted international attention after she took part in a documentary film commissioned by the European Union but later withheld.
Ms Motley said she hoped her client would be released shortly, and that there was a place for her in a women's shelter.
The palace statement said justice minister Habibullah Ghalib asked a panel of top legal officials to order her release. Gulnaz sought a pardon from Mr Karzai earlier this week.
"After assessing Gulnaz's case, (they) decided that her remaining sentence in jail should be pardoned under the current rules and regulations of the country and she should be released," the palace statement said.
Gulnaz was initially sentenced to two years in jail for "adultery by force", which was later increased to 12 years on appeal. She was given the choice of marriage or serving a jail sentence.
Her sentence was then cut to three years after a third appeal, and the requirement for her to marry was dropped.
Gulnaz became pregnant as a result of the attack and gave birth to a daughter in the Badam Bagh women's prison in Kabul almost a year ago.
Ms Motley also welcomed what she said was a decision to review the cases of other women in the same jail.
"The judiciary has effectively supported the Elimination of Violence Against Women Act by allowing for her to be released, for allowing for her to be pardoned," Ms Motley said.
"Precedent definitely has been set. As I understand it, the judiciary today was also reviewing the files of other women in Badam Bagh," she said.
The presidential palace declined to comment on whether other cases were under review.
The film in which Gulnaz featured, a documentary on women in prison, was blocked from release by the EU mission in Afghanistan over fears it might compromise the safety of the women involved because it showed their identity.
The film-makers have been pushing for the film to be released, and say Gulnaz wanted her story to be told.
"I made a promise to these women that I would get their stories out. I am glad that I've been able to honour that promise to Gulnaz," said the film's director Clementine Malpas.