Israel's Supreme Court has struck down a 2015 law granting exemptions from military service to ultra-Orthodox men.
Tuesday's decision threatened to re-ignite tensions between Israel's politically powerful ultra-Orthodox community and the secular Jewish majority.
Military service is mandatory for most Jewish men, but the ultra-Orthodox community has won exemptions. Their leaders say they serve the nation through study and prayer. Secular Israelis say the system is unfair.
Past attempts to force religious men to enlist have triggered violent protests.
Israel's government moved to reduce exemptions and increase ultra-Orthodox military service in a 2014 law. Prime Minister Benjamin Netanyahu canceled those reforms in 2015 after forming a new coalition with religious partners.
In Tuesday's decision, the court said the 2015 law is discriminatory and must be replaced.
Eight of the nine justices ruled the law should be scrapped and Supreme Court President Miriam Naor, wrote that the most recent arrangement that was made to appease the ultra-Orthodox parties "deeply harms equality in a way that damages the constitutional right to human dignity."
Since Israel's founding in 1948, ultra-Orthodox politicians have campaigned vigorously against the conscription of members of their community, who make up about 10 percent of Israel's population of 9 million.
Netanyahu's government, which controls 67 of the Knesset's 120 seats, includes both ultra-Orthodox parties, but two other influential factions oppose a further relaxation of the legislation against conscription.
Interior Minister Aryeh Deri, the leader of the ultra-Orthodox Shas party, said in response to the ruling that the justices were "completely detached from our heritage and tradition and from the people."
He encouraged seminary students to continue their Bible studies and said: "Do not despair, continue to study the Torah, we will stand firm and will do everything to fix this situation."
Opposition member Yair Lapid, whom opinion polls have shown to be a possible challenger to Netanyahu in future elections, convened a news conference to praise the court's decision, saying it had delivered a verdict that would force equality among communities.
"This is why we have come to politics. Conscription for everybody, work for everybody. Benjamin Netanyahu can no longer continue to wriggle out all the time. Military conscription is for everybody, not only for the suckers who don't have a party in his coalition," Lapid added.