WELLINGTON, New Zealand — More than 150 gun owners turned in semiautomatic weapons and gun parts to the police in Christchurch, New Zealand, on Saturday, the first day of nationwide gun buyback events after the government banned most such firearms in the wake of a terrorist attack on mosques in the city.

Mike Johnson, the commander of the district’s police department, told reporters that gun owners would be paid a total of close to $300,000 for the 224 now-illegal weapons handed over during the five-hour event.

It took place in the same city where on March 15, a lone gunman stormed two mosques, killing 51 people and injuring dozens more in an attack that rattled the nation and prompted calls for dramatic changes to gun laws.

New Zealand’s prime minister, Jacinda Ardern, announced six days after the attacks that most semiautomatic weapons, including all of the military-style firearms used by the gunman, would be outlawed. Three weeks later, the country’s Parliament overwhelmingly passed a law banning them.