By Stephen Wright

WELLINGTON, New Zealand--New Zealand's economy suffered a record contraction in the second quarter as a lockdown to halt the spread of the coronavirus kept people at home and shuttered most businesses.

Gross domestic product shrank by 12.2% in the April-June quarter from the previous quarter, Statistics New Zealand said Thursday. The economy was 12.4% smaller compared with a year earlier.

The New Zealand decline was worse than an estimated 9.8% drop in combined GDP for OECD developed nations in the same period and a 7.0% fall for neighbor Australia, which imposed a less strict lockdown.

More up-to-date indicators show that the New Zealand economy has quickly rebounded from lockdown in the third quarter.

But new Treasury Department forecasts released on Wednesday predicted that the initial bounce back will become a drawn-out recovery, with unemployment continuing to rise until the first quarter of 2022.

A Wall Street Journal poll of economists had forecast the economy to contract 12.0% in the second quarter from the first quarter.

New Zealand's strict lockdown, which began in late March, temporarily extinguished local spread of the coronavirus virus.

A three-month period of no community tranmission of the virus ended with a new outbreak in the largest city, Auckland last month that resulted in restrictions that were less severe than the first lockdown.

Write to Stephen Wright at stephen.wright@wsj.com