An Iranian woman sentenced to death for killing a police official she said had tried to rape her has been pardoned by the victim's family, officials said.
Norouzi insisted she had acted justly in defending herself
The family of Behzad Moghaddam agreed to accept compensation instead of seeking Afsaneh Norouzi's execution.
Iran's Supreme Court overturned Mrs Norouzi's death sentence in July but she still faced a lower court's ruling.
The mother of three, whose seven-year case prompted a human rights outcry, is expected to be freed soon.
The decision by Mr Moghaddam's family to accept a "blood money" payment of $62,500 (£33,200) instead of seeking Mrs Norouzi's life brings the case to an end.
A judiciary official said the death sentence could not be brought against Mrs Norouzi, now 34, again.
She and her family were visiting Mr Moghaddam, an intelligence officer on the holiday island of Kish in the Persian Gulf, in 1997 when her husband was called away.
Mrs Norouzi said she had tried to defend herself with a knife when the officer attempted to rape her.
A court in Kish eventually found her guilty of murder and condemned her to death - a sentence initially upheld by the Supreme Court last year.
However, under pressure from women's rights activists and reformist politicians, the head of the judiciary finally ordered a review before the Supreme Court, which in July quashed the death verdict.
However, it ordered a new ruling from the Kish court, which could have led to a further sentence for Mrs Norouzi.
Mrs Norouzi had refused to plead for mercy because she believed she had justly defended herself.
Women's rights activist and lawyer Sara Irani told The Associated Press news agency she welcomed the resolution of the case.
"Norouzi's freedom will give new breath to women to find the courage to stand up for their rights and defend themselves," she said.
In Iran, a married woman who is raped risks the death penalty for adultery if she cannot prove she was violated.
If she kills her attacker, she may also face the death sentence for murder.