The High Court has found a warrant used by federal police to raid a journalist's home was invalid and ordered that it be quashed.
News Corp Australia reporter Annika Smethurst had her Canberra apartment raided in 2019 over stories she wrote revealing secret plans to expand the government's spying powers.
The full bench of the High Court on Wednesday unanimously found there was not enough precision in the drafting of the warrant.
AFP Commissioner Reece Kershaw said officers had acted in good faith and police "don't set out to do illegal raids".
"Every Australian has the right to challenge these types of matters. It has been challenged and we respect the court's decision," he told reporters on Wednesday.

Australian Federal Police Commissioner Reece Kershaw said he respected the court's decision. Source: AAP
"For us it's about being respectful of the court process, which we are."
Only two judges ordered that material seized during the search be destroyed, meaning it could still be used by police.
Mr Kershaw said police would take further advice on what to do with the seized material.
"All of us want to see this resolved as expeditiously as possible. We will move very quickly," he said.
The majority of the court did not order police to destroy the data taken during the raid, as it may disclose criminal conduct.
The court did not consider whether the AFP raid infringed on implied freedom of political communication.
The AFP has been ordered to pay court costs.
In April 2018, Ms Smethurst published three stories about a proposal to allow the Australian Signals Directorate to spy on citizens without a warrant.
The matter was immediately referred to the AFP and officers eventually raided her home on June 4 last year.
Ms Smethurst was forced to reveal her phone security code before police copied information from the device to a USB.
It is not known what data is stored on the USB.