A girl carries flowers to a memorial wall following the mosque shootings in Christchurch, New Zealand, March 17, 2019. New Zealand's parliament on Wednesday passed sweeping gun laws which outlaw military-style weapons, less than a month after the nation's worst mass shooting left 50 dead and 39 wounded in two mosques in the South Island city of Christchurch. Credit: Vincent Thian | AP

New Zealand’s parliament voted almost unanimously for a law that bans most semiautomatic weapons on Wednesday evening, less than a month after 50 people were killed a by a white nationalist-inspired gunman who opened fire on two mosques in Christchurch.

All of parliament’s 120 lawmakers barring one voted in favor of the gun reforms, which make the temporary restrictions on military-style semiautomatic weapons, assault rifles and accompanying parts like magazines and ammunition for these weapons permanent. Gun owners will have till the end of September to hand them in through a buyback program, after which point amnesty will end.

The swift action — first taken just days after the worst attacks in New Zealand’s modern history and made official law just weeks after — now makes the United States even more of an outlier with regard to large-capacity semiautomatic weapons. The U.S. has not taken such action even in the string of deadly attacks by firearm, including in Las Vegas, and Parkland, Florida.

“I can recall very vividly the moment I knew that we would need to be here, doing what we are doing right now,” New Zealand Prime Minister Jacinda Ardern said. She described how the police commissioner had described to her, in the wake of the Christchurch attacks, that the weapons used were bought legally and modified. “I could not fathom how weapons that could cause such destruction and large scale death could have been obtained legally in this country.”

“We are ultimately here because 50 people died and they do not have a voice,” she added.

Firearms like the AR-15 used by the gunman in the attacks will now be banned. Ardern said she took into account concerns from New Zealand’s farmers and large rural community, who live among rolling hills and farmland across the country’s two islands. Some semiautomatic guns with magazines holding less than 10 rounds and shotguns that can hold up to five rounds will be allowed so those who legitimately use weapons for hunting purposes can continue to do so.

The New Zealand government consulted with the country’s hunting and rural community, and they overwhelmingly said that military-style weapons were not necessary.

“They have told us that they by and large, Mr. Speaker, with very few exceptions, support what we are doing here today,” Ardern said in her speech to parliament on the gun reforms. “This is not a house here that is demonizing legitimate use of firearms in New Zealand, quite to the contrary.”

In the wake of the attacks and in anticipation of the changes, some gun owners had already started handing their weapons in to police. Many said they were doing so in solidarity with the victims, including the 50 additional worshipers who had been injured in the mosque attacks. Others, according to gun store owners, had started stockpiling these firearms before the ban went into effect.

Experts studying New Zealand gun laws say such changes had been recommended to parliament several times, but always met with opposition. Four inquiries on gun laws have been undertaken by the New Zealand government in recent years, including one after a 1990 mass shooting that killed 13.

This time, parliament passed the measures in almost record time, similar to action taken in Australia after a 1996 massacre in Port Arthur, Tasmania, in which 35 people were fatally shot.

Ardern noted that among the more than who 13,000 submitted their comments to the government on this bill, some believed that parliament were rushing through the changes. She disagreed with their comments, and referenced former Australian prime minister John Howard’s decision after the Port Arthur attack.

“My view is that an argument about process is an argument to do nothing,” she said.

The gunman, who has been identified as 28-year old Brenton Tarrant, faces 50 counts of murder and 39 counts of attempted murder. Officials say more charges are likely.