(Bloomberg) --

The Israeli government must introduce legislation that allows its domestic spy agency to track phones to help contain the coronavirus outbreak or halt the practice by Thursday, the country’s High Court ruled.

While the government was justified under the circumstances in using emergency powers to allow the phone tracking, the practice infringes on basic privacy rights and must therefore be anchored in legislation, Chief Justice Esther Hayut said. The court gave the government a few weeks to complete the legislation.

Israel has been employing the technology, generally used for counterterrorism, to trace the contacts of coronavirus carriers. To date, over 15,000 coronavirus cases have been confirmed in Israel, including 202 fatalities.

Read: Counterterrorism Tools Deployed Against Virus Spur Privacy Fears

©2020 Bloomberg L.P.