New Zealand Prime Minister John Key has apologised to Megaupload.com founder, Kim Dotcom, for the illegaly intercepting personal communications by the government agencies leading to his arrest.

According to Key, the Government Communications Security Bureau (GCSB) only has authority to spy on foreigners. Dotcom, however, is a citizen of New Zealand since 2010.

The Megaupload founder was spied on by the agency prior to police raids that packed up file-storing service.

John Key said it is the GCSB’s responsibility to act within the law and it is hugely disappointing that in this case its actions fell outside the law.

"Of course I apologize to Mr Dotcom. I apologize to New Zealand," Key said.

"They [GCSB] have failed at the lowest hurdle. I’m personally disappointed. New Zealanders should be very disappointed."

Kim was arrested in January, after a raid as part of an FBI investigation, charging that Dotcom led firm had made millions from internet piracy and breaking copyright laws since 2005.

While in June 2012, a court in New Zealand court ruled that the search warrants deployed in raiding Dotcom’s home in January 2012 were illegal.

Further the company is also preparing to launch a new music site known as Megabox.

"Code was 90% done. Servers on the way. Lawyers, partners and investors ready. Be patient. It’s coming," said Kim Dotcom in a tweet about Megabox.