Nicky Hager says he couldn't be happier with a ruling that a police raid on his home last year was illegal.
The journalist's home was searched after the release of his book Dirty Politics which was based on leaked emails from blogger Cameron Slater.
Hager has always said the raid was illegal and yesterday the High Court in Wellington agreed.
The judgement released by Justice Denis Clifford says police failed to disclose the relevant information to the judge who issued the warrant and as a result, declared it "fundamentally unlawful" and by extension the search as well.
Hager says he had a right to protect his sources but police told the judge he was a writer rather than a journalist.
"They didn't actually mention anything about the media to the judge, so the judge thought they were just investigating some crime - we don't have to worry about this. They didn't give the judge the information she needed to make a proper decision about a media decision."
Mr Hager described the raid as a "weird overkill of intruding through our house".
"Unfortunately I was away so I wasn't the one who had to put up with it. The police arrived there early in the morning, there were six of them. They pulled my daughter out of bed, they got her out of bed and they wouldn't let her get dressed on her own. She had to get dressed in front of a police officer, they read her her rights," he told the Paul Henry programme.
Police spent the next 11 hours searching the home.
The court ruling is being described as a win for media freedom.
Canterbury University's Law Professor, Ursula Cheer says it's a significant decision.
"It applies to journalism generally in New Zealand and it recognises the law that was laid down quite a long time ago."
Dirty Politics exposed smear tactics within New Zealand politics, including the relationship between senior National Minister Judith Collins and Slater.
It provided the backdrop to much of last year's election campaign.
The information was given to Hager by a hacker known as Rawshark, who downloaded Slater's emails which provided the material for the book.
Police are now looking at their legal options and say they won't be commenting further.