New Zealand’s governor general has formally signed into effect sweeping gun laws outlawing military-style weapons, less than a month after a man used such guns to kill 50 people and wound dozens at two mosques in Christchurch.

Patsy Reddy signed the bill as police said a gun buyback programme will be announced to collect the now-banned weapons.

READ MORE: Christchurch shootings: New Zealand cabinet backs tighter gun laws 

The guns will be illegal from midnight, but police said a brief amnesty will be in effect until details of the buyback are announced.

Patsy Reddy signs the legislationPatsy Reddy signs the legislation (Mark Mitchell/New Zealand Herald/AP)

“For people who find themselves now in possession of a prohibited firearm, we ask you to please notify us,” Police Deputy Commissioner Michael Clement said.

“The collection of firearms will occur at a later stage. For now, there is an amnesty in place and we ask people to please notify us.”

Anyone who retains such a weapon faces a penalty of up to five years in prison. Exemptions allow heirloom weapons held by collectors or weapons used for professional pest control.

READ MORE: ‘Manifesto’ sent to New Zealand PM’s office minutes before Christchurch attack

The House of Representatives on Wednesday passed by a final vote of 119-1 legislation banning the weapons after an accelerated process of debate and public submission.

“The government acted quickly to change New Zealand’s firearms laws and police is now responsible for implementing and enforcing these new laws,” Mr Clement said.

Australian Brenton Harrison Tarrant, 28, has been charged with 50 counts of murder and 39 counts of attempted murder over the attacks in Christchurch.

A royal commission set up to investigate issues surrounding the massacre is examining how he obtained a gun licence in New Zealand and bought weapons and ammunition.

Prime minister Jacinda Ardern spoke emotionally during the bill’s final reading of the traumatic injuries suffered by victims of the March 15 attack, who she visited in Christchurch Hospital after the shootings.

Jacinda Ardern meets members of the Muslim community after a national remembrance service for the victimsJacinda Ardern meets members of the Muslim community after a national remembrance service for the victims (Mark Tantrum/New Zealand Government/AP)

“I struggle to recall any single gunshot wounds,” she said. “In every case they spoke of multiple injuries, multiple debilitating injuries that deemed it impossible for them to recover in days, let alone weeks.

“They will carry disabilities for a lifetime, and that’s before you consider the psychological impact. We are here for them.

“I could not fathom how weapons that could cause such destruction and large-scale death could be obtained legally in this country.”

Ms Ardern, who has won international praise for her compassion and leadership since the shootings, won rare bipartisan support for a bill that makes it illegal to own a military-style semi-automatic rifle.

The only dissent was from the libertarian ACT Party’s lone legislator in parliament.