All but one member of New Zealand's parliament voted to change gun laws, less than a month after deadly shooting attacks on two Christchurch mosques that killed 50 people.

The gun reform bill, which passed 119-1 after its final reading in parliament, must now receive royal assent from the governor general before it becomes law.

Brenton Tarrant, 28, was charged with 50 murder charges after the attack on two mosques on 15 March.