Lebanon's parliament on Wednesday abolished a law that allowed rapists to avoid prison by marrying their victims.

A proposal to repeal Article 522 of the penal code - which deals with rape, assault, kidnapping and forced marriage - was introduced last year and approved by a parliamentary committee in February.

The repeal of the law, which had been in place since the 1940s, follows years of campaigning by women's rights advocates.

Activists have campaigned against the country's law for more than a year, posting billboards of women in bloodied and torn wedding gowns.

READ MORE: Meet the woman who pushed to repeal Jordan's rape law

The caption reads: "A white dress does not cover the rape."

The Lebanese law states that rape is punishable by up to seven years in prison, or more if the victim is mentally or physically disabled. Article 522 added that if the rapist marries the victim, criminal prosecution is suspended.

In a statement posted on its Facebook page, the official National News Agency and activist group ABAAD congratulated women in Lebanon.

"It is no longer possible to escape punishment for rape and sexual acts carried out by force and coercion," said the group, which has spearheaded the campaign to repeal the much-reviled article.

"Today's win is a victory for the dignity of women," the NGO said.

There are no precise figures on how many rapists marry their victims to avoid punishment, but activists say the practice mainly took place in rural areas.

READ MORE: Morocco repeals 'rape marriage law'

Human Rights Watch welcomed the move by Lebanon's parliament but said more should be done to ensure women's rights.

"The repeal of article 522 is an important and overdue step to protect women's rights in Lebanon," said Bassam Khawaja, Lebanon researcher at Human Rights Watch.

"Parliament should now follow this up by passing pending legislation to end child marriage and marital rape, both of which are still legal in Lebanon."

Lebanon's decision comes just over two weeks after Jordan's parliament banned a similar article in its penal code.

Tunisia, Morocco and Egypt have cancelled similar "marry the rapist" clauses over the years.

The clause remains on the books in Algeria, Iraq, Kuwait, Libya, the Palestinian territories and Syria, as well as several countries in Latin America and in the Philippines and Tajikistan, according to Human Rights Watch.