The parliament of Nepal has criminalised an ancient Hindu practice called chhaupadi that banishes women from the home during menstruation and after childbirth.
"A woman during her menstruation or post-natal state should not be kept in chhaupadi or treated with any kind of similar discrimination or untouchable and inhuman behaviour," reads the law, passed in a unanimous vote on Wednesday.
The new law, which will come into effect in a year's time, stipulates a three-month jail sentence or a 3,000 rupee fine ($30), or both, for anyone forcing a woman to follow the custom.
Mohna Ansari, a member of national human rights commission who was part of the push for the new law, told Al Jazeera that the development was "a big achievement".
"The law gives an open space for women to come forward if they are forced to follow the practice. It is a custom that makes women feel isolated and puts psychological pressure," she said.
"Supreme court ruled against chhaupadi 12 years ago, but it was not effective because it issued just guidelines. But it also directed that in case the guidelines were ineffective, there should have been a law passed against chhaupadi, so that's what happened now."
But women's rights activist Pema Lhaki described the law as unenforceable because it is related to a deeply entrenched belief system that is harder to change.
"It's a fallacy that it's men who make the woman do this. Yes, Nepal's patriarchal society plays a part, but it's the women who make themselves follow chhaupadi," she told AFP news agency.
"They need to understand the root cause, have strategic interventions and then wait a generation."
Many communities in Nepal view menstruating women as impure, and in some remote areas, they are forced to sleep in a hut away from home called chhau goth during their periods and after childbirth.
They are also barred from touching food, religious icons, cattle and men.
Last month, a teenage girl died after being bitten by a snake while sleeping in a chhau goth.
Two other women died in late 2016 in separate incidents while also following the ritual - one of smoke inhalation after she lit a fire for warmth, while the other death was unexplained.
Rights activists say many other deaths likely go unreported.
Source: Al Jazeera and news agencies