Austria's Constitutional Court on Wednesday struck down parts of a law passed by the previous government which would have enabled authorities to read encrypted messages online using so-called "Trojan horse" software.
The court said that the powers envisaged under the law represented a "grave encroachment on the right to privacy".
Such surveillance would only be justified "in the most restricted circumstances in order to protect important legal rights," the judges said, ruling that law overstepped those boundaries.
The court also said that measures in the law enabling the automatic recording of vehicle licence plates were unconstitutional.
The law had been passed in April 2018 under the previous government, a coalition of the centre-right People's Party (OeVP) and far-right Freedom Party (FPOe), which collapsed in May of this year.
It was due to come into effect in April 2020.
When the law was passed, that government insisted that the powers would only be used in cases of suspected serious criminality.
However, the court found that law's provisions to ensure independent oversight of any surveillance were not sufficient.
The court's judgement came after the law was challenged by the liberal NEOS party and centre-left Social Democrats (SPOe).
NEOS MP Niki Scherak called the verdict a "brilliant victory for freedom" which had prevented a "frontal attack on the liberal constitutional state".
FPOe MP Herbert Kickl, who was interior minister when the law was passed, said Wednesday would be "a day of celebration for organised crime and terrorist extremism".
© 2019 AFP