The police search of journalist Nicky Hager's home last year has been ruled illegal.
The High Court in Wellington has found police failed to disclose relevant information to the judge who issued a search warrant.
The warrant was obtained and the search took place after blogger Cameron Slater laid a complaint when information from his computer, obtained by a hacker known as Rawshark, was published in Mr Hager's book Dirty Politics.
Justice Clifford declared the warrant was "fundamentally unlawful".
Mr Hager said he was very happy with the decision for his family and what he said were the important principles it upheld.
Speaking on Checkpoint, he said it was a good day for journalism.
"If this decision had gone the wrong way then all around the country, and into the future, there would have been people we needed to be speaking up on issues as sources - telling the media what was going, on letting the public know about things - who would have been more frightened of doing that."
He said the police action was a case of, "raid first and sort it out later".
"What the police thought they could do ... they thought they could raid the house, take all our stuff, and then sometime in the future in a court case decide whether they were allowed it or not."
Mr Hager's lawyer Felix Geiringer told a news conference after the judgement that the police had failed badly.
"The police failed to alert the judge to the fact that Nicky Hager was a journalist, the fact that journalists are afforded protection under the law, didn't take the judge to the leading case, didn't take the judge to what that case says has to be done before a search is conducted, and fundamentally failed to alert the judge to source protection and the danger and chill effect that this search could have," he said.
Mr Hager said more hearings would follow on other police actions taken against him, and he would be seeking costs and damages.
He had asked the court to rule on the legality of the search warrant and the search of his home last October.
Police said they received Justice Clifford's decision this afternoon and would take time to study the decision and consider further legal options with Crown Law.