The Israeli Supreme Court on Tuesday struck down military draft exemptions for Jewish seminary students, enraging the small but powerful ultra-Orthodox community.
Court documents seen by AFP showed a panel of nine justices agreed that a 2015 amendment to the law on military service treated the students more generously than their secular compatriots.
"All the justices ruled that the new draft arrangement violates equality," the decision read.
It said an eight-to-one majority went a step further, ruling that it must be struck from the law books.
Most Jewish Israelis are obliged to enlist, usually at the age of 18, with men serving for two years and eight months and women for two years.
Many continue to be called up for periodic periods of reserve duty into their 40s.
"The majority justices ruled that the annulment of the arrangement would take effect only a year from the date of the ruling, in order to enable the arrangement to be implemented," an official summary of the judgement said.
The year of grace gave the military and other authorities time to organise for an enlarged draft.
It also gave politicians a chance to find an alternative formula which would be acceptable both to the court and the ultra-Orthodox political parties, whose support is vital for the government's slender parliamentary majority.
Ultra-Orthodox leaders raged against Tuesday's decision but did not threaten the stability of Prime Minister Benjamin Netanyahu's right-wing coalition, currently halfway through its four-year term.
"It's a miserable ruling," lawmaker Menachem Eliezer Moses, of the United Torah Judaism party, told state-owned Channel One TV.
"We are certainly not going to dismantle the government," he added. "There are still two years to elections. We shall change the law."
Interior Minister Aryeh Deri, of the ultra-Orthodox Shas party, took a similar line.
"The Supreme Court is totally cut off from our (Jewish) heritage and tradition," he said on Twitter.
"We will act with all our might to amend the law to allow the continuation of the existing arrangement."
Ultra-Orthodox Jews represent about 10 percent of the Israeli population and live by a strict interpretation of Jewish laws.
There have been large and heated ultra-Orthodox protests against the draft, which many of them view as a source of temptation for young people taken out of the cloistered world of prayer and religious study.
In March thousands took to the streets and dozens have been arrested on public disorder offences in the past few months.