Image copyright Getty Images Image caption Former US National Security Authority contractor Edward Snowden (left) and others discuss the revelations about New Zealand's alleged mass surveillance, at a public meeting in Auckland

New Zealand was preparing to conduct national covert surveillance last year, a US investigative journalist has said.

The claims by former Guardian newspaper reporter Glenn Greenwald were denied by New Zealand Prime Minister John Key.

The report was based on information disclosed by former US National Security Authority (NSA) contractor Edward Snowden, who said the government had planned to exploit new spying laws.

The revelations come just days ahead of a New Zealand general election.

Kim Dotcom

The alleged spying programme came to light in part because of controversial millionaire internet entrepreneur Kim Dotcom, who brought Mr Greenwald to New Zealand.

Mr Greenwald appeared on Monday at a public meeting of more than 1,000 people organised by a political party being bankrolled by Mr Dotcom, at which the German entrepreneur had promised revelations damaging to Mr Key.

Edward Snowden and Wikileaks founder Julian Assange addressed the meeting through video links.

Kim Dotcom is fighting extradition to the US on charges of internet piracy, copyright breaches and money laundering.

There is not, and never has been, a cable access surveillance programme operating in New Zealand John Key, New Zealand Prime Minister

Glenn Greenwald said the NSA documents showed New Zealand's electronic spy agency began the surveillance by tapping into an undersea telecoms cable into the country, while waiting for the legal authority to do so. The project was dubbed "Speargun".

"Phase one entailed accessing that cable, tapping into it, and then phase two would entail metadata probes," Mr Greenwald said on Radio New Zealand National.

Prime Minister Key rejected the charges as "absolutely wrong", and said a business case put up by the agency, the Government Communications Security Bureau (GCSB), early last year was aimed at mass cyber protection, but had been turned down by his government.

"There is not, and never has been, a cable access surveillance programme operating in New Zealand," Mr Key said in a statement, as he released several declassified papers to back his position.

"There is not, and never has been, mass surveillance of New Zealanders undertaken by the GCSB."

Mr Key said also that Glenn Greenwald was being used to try to influence voters ahead of the election.

New Zealand law stipulates that the GCSB - which conducts electronic surveillance and is part of the "Five Eyes" surveillance network along with the US, UK, Australia, and Canada - can spy on New Zealand citizens only if requested by a domestic law enforcement or intelligence agency.

New Zealand media said Monday's revelations involved an alleged email between a Warner Brothers film studio executive and the Motion Picture Association of America (MPAA) - suggesting Mr Key colluded with them to allow Kim Dotcom to settle in New Zealand so that it would be easier to detain and extradite him.

Image copyright Getty Images Image caption Internet entrepreneur Kim Dotcom (right) brought US journalist Glenn Greenwald (left) to New Zealand for the spying revelations

Warner Brothers and the MPAA said the email was fake, and Mr Key said he made no such comments to the film executives.

Kim Dotcom is the founder of file hosting service Mega and the founder and main funder of New Zealand's Internet Party. The entrepreneur rose to fame in Germany in the 1990s as a self-proclaimed hacker and internet entrepreneur.

He was convicted of several crimes in Germany, receiving a suspended prison sentence in 1994 for computer fraud and data espionage, and another suspended prison sentence in 2003 for insider trading and embezzlement.

In January 2012, the New Zealand Police placed him in custody in response to US charges of criminal copyright infringement in relation to his Megaupload website.

Mr Dotcom was accused of costing the entertainment industry hundreds of millions of dollars through pirated content uploaded to his file-sharing site. He has denied the charges, and is fighting the attempt to extradite him to the US.

Controversy around Mr Dotcom's arrest and the protracted effort to extradite him have dogged the Key government over the past two years. But the prime minister remains the favourite to gain a third consecutive term, although he may need the support of minor parties to secure a majority.