Responding to a recent request by Prime Minister John Key, a New Zealand inspector general has concluded that the Government Communications Security Bureau (GCSB) broke the law when it spied on Megaupload founder Kim Dotcom in connection with January's raid on his mansion. Following the Thursday release of the report, Key issued a personal apology to Dotcom for the mistake.

The GCSB is an intelligence agency similar to the National Security Agency in the United States. Like the NSA, it is supposed to focus its surveillance activities on foreign targets. Because Dotcom had obtained permanent resident status, he does not qualify as a foreigner under the latest version of the GCSB law, and therefore should not have been subjected to GCSB surveillance. But the agency evidently misunderstood the law or failed to verify Dotcom's immigration status.

"If they had been more thorough in what they had done, they would have worked out that Mr. Dotcom had a residence class visa, and therefore was protected by the law," Key told reporters on Thursday. "Frankly, I'm pretty appalled by what I've seen because these are basic errors."

"This is really a matter of mistake and human error, not one of a great conspiracy," Key said. But he emphasized that "the agency has let itself down very badly. "

Key told reporters he did not expect the illegal GCSB surveillance to affect the fight over extraditing Dotcom to the United States, because none of the evidence the United States planned to use against Dotcom in those proceedings were derived from GCSB surveillance.

"I accept your apology," Dotcom tweeted in response to Key's statements. "Show your sincerity by supporting a full, transparent & independent inquiry into the entire Mega case."

Key is under pressure from opposition members of parliament to investigate the incident more thoroughly. Green party co-leader Russel Norman grilled Key about the oversight on Wednesday. He reiterated calls for an independent investigation on Thursday.

Key's response to the scandal is a striking contrast to the situation in the United States. When evidence of illegal surveillance activities by the American government is uncovered, the government tends to duck accountability by invoking legal theories like the state secrets privilege and the doctrine of sovereign immunity. The government has even refused Sen. Ron Wyden (D-OR)'s request for a ballpark estimate of the number of Americans whose communications have been intercepted. It's hard to imagine President Obama ordering an independent investigation of illegal NSA surveillance of Americans, to say nothing of issuing a public apology to the targets of illegal spying.