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.

The closure of New Zealand's border since mid-March is also a continuing drag on the economy by shutting down foreign tourism and keeping out international students.

"Industries like retail, accommodation and restaurants, and transport saw significant declines in production because they were most directly affected by the international travel ban and strict nationwide lockdown," the statistics agency said.

"Other industries, like food and beverage manufacturing, were essential services and fell much less," it said.

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 strictest level of pandemic lockdown, which began in late March and was in place for most of April, temporarily extinguished local spread of the coronavirus.

A three-month period of no community tranmission of the virus ended last month with a new outbreak in the country's largest city, Auckland. The government imposed new restrictions on movement and business that were less severe than the first lockdown.

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