People queuing inside supermarket, waiting to checkout

People rushed to the supermarket after New Zealand announced its first locally transmitted coronavirus infections after more than 100 days on Tuesday.

People in the country's largest city Auckland have been asked to stay at home after four cases were detected in a single family in Auckland from an unknown source.

"After 102 days, we have our first cases of COVID-19 outside of managed isolation or quarantine facilities... we have all worked incredibly hard to prevent this scenario," Prime Minister Jacinda Ardern announced.

"We have also planned and prepared for it."

New Zealand reported just 22 deaths in a population of five million and had not recorded community transmission since May 1.

Auckland will be locked down for at least three days from Wednesday and some social distancing restrictions will be reintroduced in the rest of the country.