The Moroccan government will change the law to outlaw forced marriages of minors to their rapist.

The case of Amina Filali, the 16-year-old Moroccan girl who took her own life after being forced into marriage with the man who raped her, sparked an international debate in 2012 about underage victims being forced into wedlock.

The age of consent in Morocco is 18.

The practice, still common in some part of the Arab world, is reinforced by a Moroccan law that allows anyone who abuses a female minor to receive immunity from criminal charges if they marry the girl. In the case of Filali, the judge pushed marriage on her.

Women's rights activist welcomed the move to scrap the law, which was announced by justice minister Mustapha Ramid.

"Changing this article is a good thing but it doesn't meet all of our demands," said Khadija Ryadi, president of the Moroccan Association for Human Rights.

"The penal code has to be totally reformed because it contains many provisions that discriminate against women and doesn't protect women against violence."

She singled out one part of the law that reformers needed to look at again. It distinguishes, she said, between "rape resulting in deflowering and just plain rape". The new legal article, imposes a 10-year penalty for consensual sex following the corruption of a minor but doubles the sentence if the sex results in "deflowering".

Fouzia Assouli, president of the Democratic League for Women's Rights, echoed Ryadi's concerns, explaining that the code only penalises violence against women from a moral standpoint - "not because it is violence".

The Moroccan family code, adopted in 2004, should protect children from marriage. "The right to get married is acquired by men and women from 18 years old who enjoy full mental capacities," reads Article 19 of the code.

However, according to Article 20 of the same law minors can be married if the judge issues a special licence after hearings with the parents.

"The law doesn't recognise certain forms of violence against women, such as conjugal rape, while it still penalises other normal behavior like sex outside marriage between adults," she said.

Amina killed herself by swallowing rat poison in her hometown of Larache in northen Morocco. In 2011, she was raped by a man who was 10 years her senior. The family agreed with a civil court ruling that she should marry him in order to preserve the family honour. But in the aftermath of the tragedy, the father denied the claims and said they were "advised" by the prosecutor to arrange a marriage with the man.

The minister of justice revealed that 41,098 marriages in 2010 involved underage girls - an increase of 23.59 percent compared to 2009.