Controversial new legislation allowing the Government Communications Security Bureau to spy on New Zealanders has passed its final vote in Parliament tonight.
The GCSB amendment Bill passed its third and final reading by 61 votes to 59 following another heated debate between MPs.
National, United Future and ACT backed the legislation, but all other parties voted against it. Maori Party MPs were only able to cast two of their three votes in opposition to the Bill.
The law will enable the spy agency to legally support the New Zealand Police, Defence Force and Security Intelligence Service in surveillance operations on citizens and residents.
One of the most polarising pieces of legislation in recent times, the GCSB Bill and its related legislation has been pushed through various stages by often just one vote.
The Government's rush to get the Bill through, has seen thousands turn out at protest marches and public meetings and some high-profile opposition.
Prior to the vote, Prime Minister John Key launched debate in Parliament by defending the Bill, saying that it would not give the GCSB sweeping powers to spy.
"It [the Bill] isn't a revolution in the way New Zealand conducts its intelligence operations. It is not about expanding the powers of a mysterious intelligence empire," he said.
"It simply makes clear what the GCSB may and may not do, and it fixes an Act passed under the Labour Government a decade ago which is not, and probably never has been, fit for purpose."
Mr Key also emphasised that warrants to allow for spying would not be given out without approval from the top.
"The Bill requires GCSB to get a warrant from the independent Commissioner of Security Warrants and me before it can intercept a New Zealander's communications," he said.
The Prime Minister also rejected Opposition claims that the Bill would allow "wholesale spying on New Zealanders".
"There have been claims this Bill offers no protection of
metadata and allows for wholesale collection of metadata without a
warrant. None of that is true.
"Metadata is treated the same in this Bill as the content of a communication," Mr Key said.
"So when the GCSB wants to access metadata, it is treated with the same level of seriousness and protection as if the GCSB was accessing the actual content of a communication. And there are protections around that," he explained.
Mr Key also explained that the Bill allows for conditions to put on warrants.
"I will not allow cyber security warrants in the first instance to give GCSB access to the content of New Zealanders' communications.
"There will be times where a serious cyber intrusion is detected against a New Zealander and the GCSB will then need to look at content - that's why the law allows that. But that should be the end point, not the starting point," he said.
Previously, Mr Key has promised to resign if there are any major mistakes made within the new law.
During the debate, Attorney-General Chris Finlayson emphasised that the legislation allows for a review of the GCSB in 2015 and every five to seven years thereafter.
'A sad day'
The Opposition has continually attempted to delay the Bill, arguing that it will allow widespread surveillance of citizens.
This evening, Labour leader David Shearer said that is was disappointing that the Prime Minister had left it so late in the piece to clarify aspects of the Bill.
"This is a sad day, we are passing legislation that is ad hoc, that is Mickey Mouse, that you have to have a third reading of to explain exactly what the Bill will do.
"It will do nothing to reassure New Zealanders that their private lives are safe from the prying eyes of our spies.
"Right up to the last minute, the Prime Minister has been forced to clarify exactly what the GCSB will actually achieve," he said.
Up until yesterday, Mr Shearer was still pushing for changes to be made to the legislation.
He proposed that restrictions to curb the GCSB's ability to access New Zealanders' email content should be added to the law.
Mr Shearer reached out to United Future leader Peter Dunne, who held one of the deciding votes, but the idea was swiftly shut down.
"That is far too late for a serious amendment of this type," Mr Dunne said.
Mr Shearer also said today that if Labour gets into power, they would replace the law following an inquiry into all intelligence agencies.
Echoing Mr Shearer's view, Green Party co-leader Russel Norman said that the Government has "consistently tried to confuse people" about the Bill.
"It is a very sad day in this Parliament, when it would appear we have a majority of a single vote in favour of progressing this law at a time when the global debate is exactly around these issues," he said.
Dunne thanked for his support
The GCSB bill passed its second reading by 61 votes to 59 on August 1, after Act leader John Banks and independent MP Peter Dunne agreed to back the Government.
Today, Mr Key thanked both Mr Dunne and Mr Banks for their support.
"I acknowledge Mr Dunne and Mr Banks for their efforts to strengthen this legislation, it is a better Bill for their imput," he said.
The revised GSCB bill now includes a code of principles for the spy agency to follow as well as the introduction of an oversight panel.