Authorities now have special powers to deal with a serious epidemic.
The vote yesterday was unanimous on the third readings of a set of bills, and Health Minister Pete Hodgson said all the parties had worked together to get the legislation through.
The Epidemic Preparedness Bill, which was split into seven bills because if affects different acts, contains a trigger provision that puts the special powers into force.
The Prime Minister can issue an Epidemic Notice when New Zealand is threatened by, or has to deal with, a pandemic disease likely to disrupt disrupt essential government and business activity.
Such a notice gives health and border control authorities powers to order people to supply information about their risk of being infected when they enter the country. People coming in, or in the community, can be quarantined.
Premises can be closed, public gatherings prohibited, and land, buildings, vehicles and ships requisitioned without compensation.
The police will have the power to control "any difficult behaviour".
"We need legal powers that reflect modern realities," Mr Hodgson said. "That's what this legislation delivers.
"While the media spotlight on avian influenza appears to have gone off, it's important that no one becomes complacent. It's not a question of if we will one day face a pandemic, but when."