Afghanistan's President, Hamid Karzai, has signed a law which "legalises" rape, women's groups and the United Nations warn. Critics claim the president helped rush the bill through parliament in a bid to appease Islamic fundamentalists ahead of elections in August.

In a massive blow for women's rights, the new Shia Family Law negates the need for sexual consent between married couples, tacitly approves child marriage and restricts a woman's right to leave the home, according to UN papers seen by The Independent.

"It is one of the worst bills passed by the parliament this century," fumed Shinkai Karokhail, a woman MP who campaigned against the legislation. "It is totally against women's rights. This law makes women more vulnerable."

Download the new Independent Premium app Sharing the full story, not just the headlines

The law regulates personal matters like marriage, divorce, inheritance and sexual relations among Afghanistan's minority Shia community. "It's about votes," Ms Karokhail added. "Karzai is in a hurry to appease the Shia because the elections are on the way."

The provisions are reminiscent of the hardline Taliban regime, which banned women from leaving their homes without a male relative. But in a sign of Afghanistan's faltering steps towards gender equality, politicians who opposed it have been threatened.

"There are moderate views among the Shia, but unfortunately our MPs, the people who draft the laws, rely on extremists," Ms Karokhail said.

The bill lay dormant for more than a year, but in February it was rushed through parliament as President Karzai sought allies in a constitutional row over the upcoming election. Senator Humeira Namati claimed it wasn't even read out in the Upper House, let alone debated, before it was passed to the Supreme Court. "They accused me of being an unbeliever," she said.

Details of the law emerged after Mr Karzai was endorsed by Afghanistan's Supreme Court to stay in power until elections scheduled in August. Some MPs claimed President Karzai was under pressure from Iran, which maintains a close relationship with Afghanistan's Shias. The most controversial parts of the law deal explicitly with sexual relations. Article 132 requires women to obey their husband's sexual demands and stipulates that a man can expect to have sex with his wife at least "once every four nights" when travelling, unless they are ill. The law also gives men preferential inheritance rights, easier access to divorce, and priority in court.

A report by the United Nations Development Fund for Women, Unifem, warned: "Article 132 legalises the rape of a wife by her husband".

Most of Afghanistan's Shias are ethnic Hazaras, descended from Genghis Khan's Mongol army which swept through the entire region around 700 years ago. They are Afghanistan's third largest ethnic group, and potential kingmakers, because their leaders will likely back a mainstream candidate.

Even the law's sponsors admit Mr Karzai rushed it through to win their votes. Ustad Mohammad Akbari, a prominent Shia political leader, said: "It's electioneering. Most of the Hazara people are unhappy with Mr Karzai."

A British Embassy spokesman said diplomats had raised concerns "at a senior level".