The lower house of the Indian parliament has passed a bill guaranteeing a third of seats for women in the parliament and state assemblies.

First proposed in 1996, the bill had been pending for decades amid opposition from some political parties. The Lok Sabha passed it with near unanimity after hours of fierce debate.

It must now receive approval in the Rajya Sabha, the upper house, before the president signs it into law. But it is still some way from being implemented as that would depend on the completion of India's census.

The exercise, conducted every 10 years, was set to be held in 2021 but was delayed by the coronavirus pandemic and is now expected to take place in 2025. Reported plans to redraw boundaries of assembly seats to increase the overall number of constituencies, known as delimitation, could further complicate the bill's implementation.

The passing of the bill is expected to boost the fortunes of the governing Bharatiya Janata Party (BJP) in the general elections next year. Prime Minister Narendra Modi thanked MPs who voted for the bill in Lok Sabha.

He called it a "historic legislation" that will enable greater participation of women in the political process. The bill was passed after 454 MPs from across party lines voted in its favour with only two against it.

The Lok Sabha debated the legislation for nearly eight hours, with several members of the Opposition raising concerns about its implementation even as they voiced their support. Former Congress president Sonia Gandhi said the party supported the proposed legislation but demanded its immediate implementation.

"How many years will they have to wait, two, four, eight?" Ms Gandhi asked. "Delaying this would be doing gross injustice to women." Several opposition MPs have also demanded a separate quota for women belonging to Other Backward Classes (OBCs).

Hinduism's caste system puts Brahmins or priests at the top, and Dalits (formerly untouchables) and Adivasis (tribespeople) at the bottom. In between are a multitude of lower and intermediate castes, which are roughly believed to constitute about 52% of the population, and are recognised as Other Backward Classes or OBCs.

While India's census has always recorded the population of Dalits and Adivasis, it has never counted the OBCs. The proposed bill provides for one-third of the seats, which are already reserved for Dalits and tribespeople, to be reserved for women.

But it excludes a similar sub-quota for women who belong to OBCs. Speaking in parliament, Ms Gandhi said the government should conduct a caste census - or a count of OBCs - and extend the benefits of the proposed law to women from those groups as well.

Some other opposition MPs called the move an eyewash by the ruling party. MP Asaduddin Owaisi, one of the two votes against the bill, said the current bill would only benefit upper caste women.