WELLINGTON, Aug 5 (Reuters) - New Zealand's unemployment rate unexpectedly fell in the second quarter, but the data masked weakness in the labour market as fewer people looked for work and the number of hours worked plunged amid tight coronavirus restrictions.

The headline jobless rate fell to 4.0% from 4.2% in the last quarter, defying the expectations of economists polled by Reuters for an unemployment rate of 5.8%.

With the country in COVID-19 lockdown when the quarter began, fewer people who did not have a job were actively seeking work, Statistics New Zealand said in a statement.

But the underutilisation rate, a measure of those who want to work but cant, rose from 10.4% to 12.0% – the largest quarterly rise since 2004.

The hours worked were down by over 10% – another record.

"Today’s data massively understate the weakness that was prevailing in the labour market in Q2, due to measurement issues," ANZ Senior Economist Liz Kendall said in a note.

Kendall said she expects the Reserve Bank of New Zealand (RBNZ) to add more stimulus through its quantitative easing programme when it decides on monetary policy next week.

Employment dropped a much smaller-than-expected 0.4% quarter-on-quarter compared with a forecast 2.0% drop.

The Treasury had forecast unemployment rate to hit 8.3% in June. New Zealand’s jobless rate is far below 7.4% in Australia and 11.1% in the U.S.

New Zealand's early response to the pandemic has allowed the economy to return to pre-pandemic normalcy.

But the government has warned of a second wave of infections, and fears jobs will be lost when the state wage subsidy scheme ends next month.

"These numbers show that going hard and early to beat the virus works," said Finance Minister Grant Robertson.

"However, we know there are still some tough times to come," he said, adding that the treasury sees unemployment peaking in the September quarter. (Reporting by Praveen Menon; Editing by Sam Holmes and Michael Perry)