New Zealand has banned military-style semiautomatic weapons and assault rifles, Prime Minister Jacinda Ardern announced Thursday, just six days after attacks on two mosques in Christchurch that left 50 people dead.

A buyback program will be launched to take existing weapons out of circulation, and those who do not comply will be subject to fines, she said.

“On 15 March, our history changed forever. Now, our laws will, too,” Ardern said. “We are announcing action today on behalf of all New Zealanders to strengthen our gun laws and make our country a safer place.”

The gunman who attacked the Al Noor and Linwood mosques here Friday used AR-15 rifles in the worst mass shooting New Zealand has ever seen. In addition to the 50 killed, 40 people were injured.

New Zealand has a tradition of hunting and shooting as sport, but there is no legal provision to own weapons for self-defense.

Ardern has said there is no reason for New Zealanders to own these kinds of weapons, and there is broad consensus on that argument.

The center-right opposition National Party supported the ban, with its leader, Simon Bridges, saying it was “imperative in the national interest to keep New Zealanders safe.”

The changes mean that the weapons will now be removed from circulation.

After the return period has passed, those who continue to own them will be liable for a $2,700 fine or up to three years imprisonment.

“We’re looking to increase the penalty when the ban is in full force and the opportunities of buyback are over,” Ardern said.

The killings have shocked New Zealand into action. 

Authorities warned Wednesday that the death toll could have been even higher.

New Zealand Police Commissioner Mike Bush said Wednesday that the admitted gunman, a 28-year-old Australian who is in custody in Christchurch, was on his way to attack another target when he was apprehended. Bush did not disclose the location of the next target, but the manifesto the admitted shooter posted online made reference to a mosque in Ashburton, about 55 miles south of Christchurch.

“We strongly believe we stopped him on the way to a further attack, so lives were saved,” Bush said.

The suspect was intercepted within 21 minutes of the first calls coming in, he said.