New Zealand's prime minister called on Monday for an inquiry into illegal spying on individuals connected with the now defunct file-sharing site Megaupload by one of the country's intelligence services.

New Zealand's prime minister called on Monday for an inquiry into illegal spying on individuals connected with the now defunct file-sharing site Megaupload by one of the country's intelligence services.

Prime Minister John Key said Monday in a statement that the Crown Law Office filed a memorandum with Auckland's High Court advising that the Government Communications Security Bureau (GCSB) "had acted unlawfully while assisting the police to located certain individuals subject to arrest warrants issued in the case."

The GCSB's director informed Key of the situation on 17 September, who then referred the issue to Inspector-General Hon. Paul Neazor, an independent statutory officer who can enquire into the compliance of the GCSB with the law.

Key "expressed his disappointment that unlawful acts had taken place," the statement said. "I expect our intelligence agencies to operate always within the law," Key said. "Their operations depend on public trust."

The memorandum will be addressed on Wednesday in Auckland's High Court, according to a Crown Law Office spokeswoman, who said she could not comment further. The Crown Law Office is the New Zealand government's legal advisor, which is representing US interests in the Megaupload case.

The US is seeking the extradition of Megaupload founder Kim Dotcom and three other individuals indicted in the US on charges of criminal copyright violations and fraud. The US Department of Justice alleges Megaupload collected US$175 million in criminal proceeds, rewarding users for uploading and sharing content without the permission of copyright holders.

One of Dotcom's attorneys, William Akel said Monday he had just been informed of the Crown Law Office's memorandum to the High Court and could not comment. On Twitter, Dotcom wrote: "Copyright is now officially a matter of national security in New Zealand."

Key's announcement marked another unexpected twist in Megaupload's legal battle. In June, New Zealand's High Court found the raid conducted against Dotcom's mansion was illegal since it used invalid warrants that were overly broad.

Last month, New Zealand's High Court ruled that Megaupload can take out a NZ$6 million ($4.8 million) loan to pay its legal bills and rent for founder Dotcom. The advance, which was opposed by the Crown Law Office, will be secured against $10 million in New Zealand government bonds held by Dotcom but which have been frozen since April by a court order, according to the ruling by Justice Judith Potter.