New Zealand’s governor general on Thursday 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.

Governor General Patsy Reddy signed the bill as police said a gun buyback program will be announced to collect the now-banned weapons. The weapons will be illegal starting at midnight, but police said a brief amnesty program will be in effect until details of the buyback are announced.

“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. “

He added that “for now, there is an amnesty in place and we ask people to please notify us,” he added.

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

The House of Representatives on Wednesday passed by a final vote of 119 to 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,” Clement said.

Australian Brenton Harrison Tarrant, 28, was charged with 50 counts of murder and 39 counts of attempted murder. The royal commission set up to investigate issues surrounding the massacre is examining how he obtained a gun license in New Zealand and purchased 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, whom she visited in Christchurch Hospital after the shootings.

“I struggle to recall any single gunshot wounds,” Ardern 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,” she said.

Ardern, who has won international praise for her compassion and leadership since the shootings, was able to win 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 lawmaker in Parliament.