New Zealand has banned all semi-automatic, military-style weapons less than a week after the Christchurch mosque shootings, prime minister Jacinda Ardern said.

Unveiling details of the plan agreed by cabinet earlier this week, she said assault rifles and “related parts used to convert these guns (such as bump stocks) are also being banned, along with all high-capacity magazines”.

It comes after the alleged gunman in the shootings in Christchurch, which killed 50 people attending Friday prayers at two mosques in the city, was able to legally acquire the full arsenal of deadly weapons used in the attack.

“Every semi-automatic weapon used in the terrorist attack on Friday will be banned,” Ms Ardern said.

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

New Zealand shootings: Victims of Christchurch mosque terror attacks Show all 11 1 /11 New Zealand shootings: Victims of Christchurch mosque terror attacks New Zealand shootings: Victims of Christchurch mosque terror attacks Zakaria Bhuiyan People gather hoping to find out information about Zakaria Bhuiyan who is still missing after the mosques shootings in Christchurch. David Moir/AFP New Zealand shootings: Victims of Christchurch mosque terror attacks Mucad Ibrahim Three-year-old Mucad Ibrahim, the youngest known victim of the mass shooting at two mosques in Christchurch, New Zealand, on 15 March 2019. Abdi Ibrahim via AP New Zealand shootings: Victims of Christchurch mosque terror attacks Nadeem Rasheed Nadeem Rasheed, brother of Pakistani Naeem Rashid who died alongside his son Talha Naeem, 21, who were killed in shooting at a Mosque in Christchurch, at their home town in Abbottabad, EPA New Zealand shootings: Victims of Christchurch mosque terror attacks Omar Nabi Omar Nabi speaks to the media about losing his father Haji Daoud Nabi, 71, in the mosque attack REUTERS New Zealand shootings: Victims of Christchurch mosque terror attacks Ash Mohammed Ash Mohammed, right, talks to a police officer about his father and two brothers who are missing near the Masjid Al Noor mosque AP New Zealand shootings: Victims of Christchurch mosque terror attacks Akhtar Khokhur Akhtar Khokhur, 58, shows a picture of her missing husband Mehaboobbhai Khokhar, 65. AP New Zealand shootings: Victims of Christchurch mosque terror attacks Wasseim Alsati A note is seen on a window of a door at the family home of Wasseim Alsati in Christchurch on 17 March 2019. AFP/Getty Images New Zealand shootings: Victims of Christchurch mosque terror attacks Haroon Mahmood Relatives offer condolences to nephew (centre) of Haroon Mahmood, a Pakistani citizen who was killed in Christchurch mosque shootings. AP New Zealand shootings: Victims of Christchurch mosque terror attacks Farid Ahmed Farid Ahmed (pictured) survived the Al Noor mosque shootings but his wife Husne was killed. AFP/Getty Images New Zealand shootings: Victims of Christchurch mosque terror attacks Syed Areeb Ahmed A relative shows a picture of Syed Areeb Ahmed, a Pakistani citizen who was killed the Christchurch mosque shooting. AP New Zealand shootings: Victims of Christchurch mosque terror attacks Naeem Rashid A relative looks at a picture on a mobile phone of Pakistani nationals Naeem Rashid and his son Talha Naeem (right) who died in the Christchurch shootings. AFP/Getty Images

The prime minister said an amnesty would be issued for New Zealanders who own the types of weapons being banned, and that a government buy-back scheme could cost “anywhere from $100m to $200m” (£52m-£104m).

“But that is the price that we must pay to ensure the safety of our communities,” she said.

New Zealand, a country of less than 5 million people, has an estimated 1.2-1.5 million firearms, around 13,500 of them military-style, semi-automatic (MSSA)-type weapons, according to Reuters.

The country has discussed enforcing stricter gun laws in the past, but came up against a powerful gun lobby. Supporters argue that rural farmers use the weapons for killing pests and putting down injured livestock, and there is also a popular recreational hunting industry.

Ms Ardern said that similar to Australia, the new gun laws will allow for strictly enforced exemptions for farmers to conduct pest control and animal welfare.

“I strongly believe that the vast majority of legitimate gun owners in New Zealand will understand that these moves are in the national interest, and will take these changes in their stride.”

Federated Farmers, which represent thousands of farmers, said it supported the change.

“This will not be popular among some of our members but ... we believe this is the only practicable solution,” spokesman Miles Anderson said in a statement.

At one of several memorials for the victims Polly Collins, 64, of Christchurch, said she was thrilled to hear of Ms Ardern’s announcement.

“The prime minister is amazing,” she said. “It’s not like in America, where they have all these things and then they go, ‘Oh yeah, we’ll deal with the gun laws’, and nothing’s done.”

Meanwhile, preparations were under way for a massive Friday prayer service, one week on from the attack, to be led by the imam of one of the two New Zealand mosques where worshippers were killed.

Imam Gamal Fouda said he is expecting 3,000 to 4,000 people at Friday’s prayer service, including many who have come from abroad.

At least six funerals took place on Thursday, including for a teenager and a youth football coach. Cashmere High School student Sayyad Ahmad Milne, 14, was known as an outgoing boy and the school’s futsal goalkeeper.

Tariq Rashid Omar, 24, graduated from the same school, played football in the summer and was a beloved coach of several youth teams.

In a post on Facebook, Christchurch United Football Club academy director Colin Williamson described Omar as “a beautiful human being with a tremendous heart and love for coaching”.

Linda Armstrong, 64, a third-generation New Zealander who converted to Islam in her fifties, was also buried, as were Hussein Mohamed Khalil Moustafa, 70, Matiullah Safi, 55, and Haji Mohammed Daoud Nabi, 71.

Families of those killed had been awaiting word on when they could bury their loved ones.

Police commissioner Mike Bush said authorities have formally identified and released the remains of 21 victims. Islamic tradition calls for bodies to be cleansed and buried as soon as possible.

Australian Brenton Tarrant has been charged with murder. The 28-year-old is next scheduled to appear in court on 5 April.