JERUSALEM — After years of heated public debate and political wrangling, Israel’s Parliament on Wednesday approved landmark legislation that will eventually eliminate exemptions from compulsory military service for many ultra-Orthodox students enrolled in seminaries.

The issue has become a social and political lightning rod in a country where most Jewish 18-year-olds are subjected to compulsory military service for up to three years. Many Israelis, who see conscription as part of a deeper culture war between the secular and modern Orthodox Jews and the ultra-Orthodox, have been demanding a more equitable sharing of the responsibilities of citizenship and voted in last year’s elections on that basis.

Yair Lapid, the leader of the centrist Yesh Atid, one of the parties that promoted the new legislation in the governing coalition, wrote on his Facebook page soon after the vote, “To the 543,458 citizens of Israel who elected Yesh Atid: Today you have passed the equal sharing of the burden.”

But the law, approved by 65-to-1, is unlikely to allay the acrimony over ultra-Orthodox recruitment and might even exacerbate tensions. The opposition in the 120-seat Parliament, the Knesset, boycotted the vote in an uproar over what it has called unfair political dealing within the coalition as it moved to pass military service legislation and two other contentious bills this week.