New Zealand's spy agency has apologized to Kim Dotcom after acknowledging it broke the law by spying on him.
And the country's Prime Minister John Key also apologized to the Megaupload founder for what he has described as "basic errors'' by the Government Communications Security Bureau (GCSB), according to the Fairfax media.
Dotcom, a German-born internet millionaire wanted by US authorities for racketeering and money laundering, was arrested in January after police raided his New Zealand mansion at the request of the FBI.
US prosecutors want him extradited to face charges of internet piracy and breaking copyright laws via his file-sharing website.
However, a New Zealand court ruling in June that search warrants used in the raid were illegal.
Key subsequently asked the government's Intelligence and Security division to investigate "circumstances of unlawful interception of communications of certain individuals by the Government Communications Security Bureau."
The GCSB is authorized only to spy on foreigners, while Dotcom gained New Zealand residency in 2010, the Associated Press reported.
Fairfax reported a report by the Intelligence and Security division as finding that the GCSB carried out surveillance on Dotcom without confirming his residency status.
Rather, it relied on information from the Organized and Financial Crime Agency New Zealand.
Key said he was "appalled'' at the agency, which had had "failed at the most basic of hurdles," according to APNZ.
"Of course I apologize to Mr Dotcom, and I apologize to New Zealanders,'' Key said at a media conference.
"They have let themselves down. They have let New Zealand down," he said of the GCSB.
"If they had done their job properly they should have worked it out. I'm personally disappointed. New Zealanders should be very disappointed. They have failed on the most basic of levels."
He said New Zealanders were entitled to be protected by the law "and we failed to provide that protection to them," a reference to Dotcom and his co-accused, Bram van der Kolk.
Key said he did not believe any of the information collected had been passed onto the FBI, nor would it be admissible in a court if Dotcom were to go to trial.
The GCSB will now go back and check all cases from 2009 until now to ensure illegal spying did not lead to any action being taking.
More from GlobalPost: New Zealand to investigate alleged illegal spying in Kim Dotcom case