In its decision, the court said parliament must begin the legislative process by Thursday.
Israel last month said it was using the Shin Bet's phone-surveillance technology to identify people exposed to the coronavirus by retracing the movements of those who were already infected. People who had come into close contact with the infected were then ordered into home quarantine.
While officials have defended the practice as a life-saving measure, civil rights groups attacked it as an assault on privacy rights.
Adalah, an Arab-run advocacy group that challenged the order, praised the court decision but said it was “gravely concerned” that it had given the government so much time to conduct and legislate the practice.
“A Supreme Court decision that acknowledges this illegality but nevertheless allows it to continue severely harms the civil rights of all citizens," it said.
The Shin Bet said it was reviewing the decision and had no further comment. But Cabinet Minister Yuval Steinitz, an ally of Prime Minister Benjamin Netanyahu, called the ruling “worrying” and accused the court of “excessive and unnecessary intervention.”
Meanwhile, Health Minister Yaakov Litzman informed Netanyahu that he would step aside as the country forms a new government. In a statement, he made no mention of his much-criticized performance at the Health Ministry, which he has led for most of the past decade. Instead, he'll take over the Housing Ministry to deal with the country's housing crisis.
The government has generally been lauded for keeping the coronavirus crisis in check. The virus has infected over 15,000 Israelis and killed nearly 200 people, but Israel has not seen its health system overwhelmed like hard-hit places such as Italy or New York, and the country has begun easing weeks of lockdown.
Litzman, an ultra-Orthodox politician with no formal medical training, has come under criticism for appearing ill-prepared at news conferences and reportedly resisting proposals to tighten lockdown measures that would affect the country's religious community. Early this month, Litzman was diagnosed with COVID-19, apparently after ignoring his own ministry's orders to avoid group prayer in public places. He has since recovered.
In a TV interview Sunday, Litzman said he had never violated lockdown rules and was leaving his job because he was ready for a new challenge, not because of public pressure.
"It’s clear things have changed for the better," he told Channel 13 TV, referring to the outbreak.
Also Sunday, Saudi Arabia signed its coronavirus testing deal with China’s BGI Group. The deal also provides the kingdom with 500 experts, specialists and technicians that will conduct tests in six new laboratories.
Saudi Arabia said it's in "a race against time to diagnose cases and to work to isolate them.” The contract also includes conducting comprehensive community testing, genetic mapping of a number of samples in the kingdom and analysis of immunity mapping from 1 million samples.
Saudi Arabia has signed agreements with companies in the U.S., South Korea and Switzerland, and wants to test 40% of its population. More than 17,000 confirmed cases of the virus have been reported there, including more than 130 deaths.
Syria, which has reported three deaths and 42 confirmed cases, decided Sunday not to reopen schools as a precaution. All elementary and high school students will automatically move up to the next grade. Universities will stay closed until at least the end of the Muslim holy month of Ramadan on May 23.
In the Gaza Strip, Hamas announced the reopening of restaurants and coffee shops where people can smoke water pipes. Hamas had closed down the establishments early this month.
Gaza, largely closed off by an Israeli-Egyptian blockade, has reported just 17 virus cases, all of them in quarantine centers for people who returned from abroad.
Associated Press writers Aya Batrawy in Dubai, United Arab Emirates, and Albert Ali in Damascus, Syria contributed to this report.