JERUSALEM (AP) — Israel’s Supreme Court on Monday struck down a key component of Prime Minister Benjamin Netanyahu’s contentious judicial overhaul, delivering a landmark decision that threatens to reopen the fissures in Israeli society that preceded the country’s ongoing war against Hamas.

The planned overhaul sparked months of mass protests, threatened to trigger a constitutional crisis between the judicial and legislative branches of government and rattled the cohesion of the powerful military.

Those divisions were largely put aside after Hamas militants carried out a bloody cross-border attack in southern Israel on Oct. 7, triggering a war that has raged in Gaza for nearly three months. But Monday's court decision could reignite those tensions, even while the country remains at war.

Justice Minister Yariv Levin, a Netanyahu ally and the architect of the overhaul, lambasted the court's decision, saying it demonstrated “the opposite of the spirit of unity required these days for the success of our soldiers on the front."

The ruling “will not discourage us,” Levin said without indicating whether the government would try to revive his plan in the short term. "As the campaigns are continuing on different fronts, we will continue to act with restraint and responsibility,” he said.

In Monday’s decision, the court narrowly voted to overturn a law passed in July that prevents judges from striking down government decisions they deem “unreasonable.” Opponents had argued that Netanyahu’s efforts to remove the standard of reasonability opens the door to corruption and improper appointments of unqualified cronies to important positions.

The law was the first in a planned overhaul of the Israeli justice system. The overhaul was put on hold after Hamas militants carried out their Oct. 7 attack, killing some 1,200 people and kidnapping 240 others. Israel immediately declared war, and is pressing forward with an offensive that Palestinian health officials say has killed nearly 22,000 people in Gaza.

In an 8-7 decision, the Supreme Court justices struck down the law because of the “severe and unprecedented harm to the core character of the State of Israel as a democratic country.”

The justices also voted 12-3 that they had the authority to overturn so-called “Basic Laws,” major pieces of legislation that serve as a sort of constitution for Israel.

It was a significant blow to Netanyahu and his hard-line allies, who claimed the national legislature, not the high court, should have the final word over the legality of legislation and other key decisions. The justices said the Knesset, or parliament, does not have “omnipotent” power.

Netanyahu's government could seek to ignore Monday's ruling, setting the stage for a constitutional crisis over who has ultimate authority.

Netanyahu and his allies announced their sweeping overhaul plan shortly after taking office a year ago. It calls for curbing the power of the judges, including by limiting the Supreme Court’s ability to review parliamentary decisions and changing the way judges are appointed.

Supporters said the changes aim to strengthen democracy by circumscribing the authority of unelected judges and turning over more powers to elected officials. But opponents see the overhaul as a power grab by Netanyahu, who is on trial for corruption charges, and an assault on a key watchdog.

The Movement for Quality Government in Israel, a good-government group that opposed the legislation, called the Supreme Court's ruling “a tremendous public victory for those who seek democracy.”

“Only an unreasonable government, one that acts unreasonably, that makes unreasonable moves, abolishes the reasonablility standard,” the group’s chairman, Eliad Shraga, said.

Before the Israel-Hamas war, hundreds of thousands of Israelis took to the streets in weekly protests against the government. Among the demonstrators were military reservists, including fighter pilots and members of other elite units, who said they would stop reporting for duty if the overhaul was passed. Reservists make up the backbone of the Israeli military.

While the reservists quickly returned to duty after the Oct. 7 attacks in a show of unity, it remains unclear what would happen if the overhaul efforts were revived. A resumption of the protests could undermine national unity and affect the military’s readiness if soldiers refused to report for duty.

Under the Israeli system, the prime minister governs through a majority coalition in parliament — in effect, giving him control over the executive and legislative branches of government.

As a result, the Supreme Court plays a critical oversight role. Critics say that by seeking to weaken the judiciary, Netanyahu and his allies are trying to erode the country’s checks and balances and consolidate power over the third, independent branch of government.

Netanyahu’s allies include an array of ultranationalist and religious parties with a list of grievances against the court.

His allies have called for increased West Bank settlement construction, annexation of the occupied territory, perpetuating military draft exemptions for ultra-Orthodox men, and limiting the rights of LGBTQ+ people and Palestinians.

The U.S. had previously urged Netanyahu to put the plans on hold and seek a broad consensus across the political spectrum.

The court issued its decision because its outgoing president, Esther Hayut, is retiring and Monday was her last day on the job.