JERUSALEM — The Israeli Supreme Court has invalidated a law that exempted from military service ultra-Orthodox Jews engaged in religious studies, adding a new urgency to the government’s negotiations with religious parties over a more equitable distribution of the burdens of citizenship.

The 6-to-3 decision, handed down late Tuesday, declared the so-called Tal Law unconstitutional at a time of growing tension in Israel over the place of the ultra-Orthodox. The law, in effect since 2002, granted exemptions to tens of thousands of religious academy students. It was widely viewed as a failure, and Prime Minister Benjamin Netanyahu had already said it would not be renewed when it expired this summer.

Still, the ruling will now force the government’s hand to come up with a new way forward, one that will be strongly resisted by religious party coalition members.

Departing Chief Justice Dorit Beinisch, writing for the court majority, said the law had failed to live up to its aim of increasing the number of ultra-Orthodox in the army. Using data presented by the army, the decision noted that last year fewer than 1,300 ultra-Orthodox youths enlisted out of a pool of 8,500, a rate of 15 percent. Among the rest of the Jewish population, the enlistment rate is 75 percent.