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.