A new law designed to crack down on exploitation of migrant workers has narrowly passed in Parliament, as the Government takes fire over the handling of a case of Chinese rail engineers in Lower Hutt.

The Immigration Amendment Bill (No 2) passed its final reading in Parliament on Thursday, meaning exploitation of migrant workers can now lead to up to seven years in jail.

Workplace Relations Minister Michael Woodhouse said the legislation would "make a big difference in protecting some of our most vulnerable workers".

Under the new law, employers who exploit temporary workers could face hefty jail sentences or fines of up to $100,000. Employers here on residence visas who exploit migrant workers could be deported if offences are committed within 10 years of gaining residence.

Tougher search powers will extend to employers' premises.

"The tough penalties reflect the seriousness of such offences and reinforces that this Government does not tolerate employers who exploit migrant labour for their own commercial advantage and will do everything possible to stamp out this abhorrent practice."

Woodhouse has been under fire this week for his comments about a recent investigation by the Ministry of Business, Innovation and Employment (MBIE) into workers removing asbestos from KiwiRail trains in Lower Hutt.

MBIE found allegations about the treatment of the workers were not supported, even though it admitted it could not ascertain what the Chinese workers were paid because their employers, who were also Chinese, refused to hand over wage records.

The investigation found no fault, however, as MBIE said its legal advice was that it was "more than likely" that New Zealand employment law would not apply as the workers were China-based and only here temporarily.

Woodhouse said he was "very happy with the circumstances under which they were asked to do the work in New Zealand".

Labour, the Green Party and NZ First all opposed the legislation. Iain Lees-Galloway, Labour's spokesman on labour issues, said that the select committee process raised a number of concerns which led the party to conclude that the legislation would not achieve its aims.