New Zealand Prime Minister Jacinda Ardern announced plans Monday to lift coronavirus-related restrictions for most of the country, saying the nation’s mystery outbreak that began in August appears to be largely under control.

The cluster of cases detected in Auckland, the country’s largest city, disrupted what had been a relatively normal few months for New Zealanders, even as other countries that had enacted stringent measures to control the spread of the virus earlier in the pandemic recorded surges in new case numbers.

Restrictions are to be eased Monday evening everywhere in New Zealand except Auckland. Rules there will be eased starting Wednesday evening, when residents will again be allowed to attend gatherings of up to 100 people. But some provisions will remain in place, including mandatory mask use on trains and ferries, as well as planes entering, departing or passing through the city. Officials will reconsider those measures early next month.

Although such mask rules will not be in place elsewhere in the country, Ardern urged New Zealanders to continue wearing them in certain environments to protect themselves and the community.

“Our actions collectively have managed to get the virus under control,” Ardern told reporters on Monday. But, she added, “Auckland needs more time.”

Residents should seek testing “even if it is just a sniffle or a cough,” she said.

The country took heed of the threat of the virus early this year and moved quickly to stop its spread.

With about 100 confirmed cases in March, New Zealand required residents to stay at home unless participating in essential activities, such as trips to the grocery store. As other countries faced enormous case counts and shortages of protective equipment and hospital beds, New Zealand was able to slowly ease the restrictions over several months.

By June, when no new cases had been confirmed in more than two weeks, officials lifted the stay-at-home order, and the nation saw more than 100 days without recording a single case of community transmission.

Borders remained closed to most travelers, and individuals entering the country from abroad were required to complete a supervised isolation period before entering society.

Then, last month, four members of a single family — none of whom had traveled recently — tested positive for the virus.

“We have had 102 days, and it was easy to feel New Zealand was out of the woods,” Ardern said at the time. “No country has gone as far as we did without having a resurgence. And because we were the only ones, we had to plan. And we have planned.”

Auckland returned to a strict lockdown while residents of other parts of the country were told to wear masks when social distancing wasn’t possible, and to stay home whenever possible.

Cases ticked upward as officials identified others linked to that cluster, as well as what they called sub-clusters.

Last month, Ardern announced she would push the country’s general election — in which she is up for reelection — back by a month, to Oct. 17.

But on Monday, Ardern expressed optimism that if New Zealanders continue to take precautions, the outbreak can remain under control.

“Our response safeguarded the health of New Zealanders while allowing the economy to operate at near-normal levels,” she said.

The nation’s caution, she said, is what has allowed its economy to be “more open than nearly any other country in the world.”