Megaupload mogul Kim Dotcom is free to press charges against a New Zealand spy agency and the police, a High Court ruled. The judge also called for classified data allegedly shared with the US to be disclosed to the courtroom.

This new twist in the Megaupload legal battle will allow Dotcom to press charges against both the New Zealand police and the Government Communications Security Bureau (GCSB).

The verdict is a small victory for the Internet tycoon in his battle against extradition to the US on charges of copyright infringement and money laundering in connection with media streaming site Megaupload, which was closed down in January by US authorities.

In addition to the ruling in favor of the Megaupload founder, the judge presiding over Dotcom’s case, Justice Helen Winklemann, called for the disclosure of all documents pertaining to the site’s operations. Winklemann said that the details, and all the entities with which they had been shared, included "members of Echelon/Five Eyes, including any United States authority.”

Echelon is an international intelligence agency of which the US and New Zealand are members, along with the UK, Australia and Canada.

The prosecution argued that some of the information is too sensitive to be released, and could potentially damage New Zealand’s relations with Washington.

Dotcom has claimed on numerous occasions that the GCSB, which surveils foreigners in New Zealand, illegally spied on him in the run-up to the raid on his mansion on January 20. Justice Winklemann subsequently ruled that the raid was illegal.

Armed New Zealand police stormed Dotcom’s $30 million mansion in January. They seized Dotcom’s assets, including 18 vintage cars and $42 million in suspected illegal proceeds.

The GCSB has admitted it unlawfully kept tabs on Dotcom and his Dutch colleague, Bran van der Kolk, prior to the mansion raid. Both men were New Zealand residents at the time of the surveillance, meaning that the GCSB acted outside of its jurisdiction. New Zealand’s Prime Minister has since issued an official apology for the offense.

­Live footage of the raid Justice Winklemann also presented evidence that suggested the illegal storming of the Megaupload founder’s mansion was broadcast over a live feed, contradicting previous police statements.

In an internal publication of the New Zealand police published in February, Detective Superintendent Mike Pannet said he had monitored termination activities around the world regarding Megaupload and the raid of Dotcom’s property. Justice Winklemann has issued an order requiring Pannet to file an affidavit detailing the nature of the monitoring he carried out.

Kim Dotcom’s marathon court case has been dogged with controversy from the outset, including allegations of excessive force by the police when they sacked the Internet tycoon’s mansion.

The extradition hearing to decide whether the file-sharing kingpin will be sent to the US for trial has been delayed at least until July 2013.