The bill comes six months after a gunman killed 51 people at two mosques in Christchurch.
The buyback program was launched months after Prime Minster Jacinda Ardern banned military-style semiautomatic weapons.
The shooter may have acted alone, but he is part of a network that stretches from Christchurch to Charlottesville.
A gunman killed 51 people in March during a mass attack on Christchurch's Muslim community.
Brenton Tarrant, a suspected white supremacist, also faces 51 charges of murder and 40 of attempted murder.
Other governments and tech companies are reportedly supporting the call to action following the shootings at New Zealand mosques earlier this year.
The Duke of Cambridge talked about "loss in my own life" during his address at a Christchurch, New Zealand, mosque targeted in March's terror attack.
The bill was passed by a vote of 119 to 1 in the House of Representatives, less than a month after mass shootings in Christchurch.
John Edwards minced no words in his criticism of Facebook in the wake of the Christchurch shootings. The tech giant "cannot be trusted," he said.
The judge said 28-year-old Australian Brenton Harrison Tarrant was charged with 50 counts of murder and 39 counts of attempted murder.
After the Christchurch attack, New Zealand faces the question of how to deny the accused shooter a platform to spread hate.
Thomas Alonzo Bolin, a 22-year-old who managed a white supremacist Facebook group, was charged with lying to the FBI about his weapons.
Jacinda Ardern called for an end to the "vicious cycle of extremism breeding extremism."
The New Zealand prime minister's reaction to the Christchurch mass shootings shows we can break out of default reactions of numbness and denial.
This New World
Martin Sellner, head of the Identitarian Movement of Austria, said his apartment was searched and electronic devices seized.
One week after New Zealand's horrific mosque massacres, a local paper shared a message of peace.
Prime Minister Jacinda Ardern joined religious leaders in Christchurch following last week’s massacre at two mosques.
New Zealand announced the ban just six days after these weapons were used in the Christchurch mosque massacre.
Police said they have spoken with the person incorrectly named and have apologized.
Wrapped in white cloth, the bodies were laid to face Mecca, and, after jenazah (funeral) prayers, were carried towards their freshly dug graves.