The lockdown in New Zealand for the first nine days imposed in March, restricting people to their homes to contain the spread of the coronavirus, was illegal but justified, a court said on Wednesday, according to Reuters.

The court said that an order for restricting people at home was not passed till April 3, while calls for the same were made by Prime Minister Jacinda Ardern and other officials since March 26. So, the residents of New Zealand were unlawfully restricted to their homes for the first nine days, it added.

“While there is no question that the requirement was necessary, reasonable and proportionate response to the Covid-19 crisis at that time, the requirement was not prescribed by law,” the court said.

The ruling came after Wellington lawyer Andrew Borrowdale challenged the legality of the early days of the lockdown, including the prime minister’s call to stay at home. The court dismissed all other charges, including the definition of “essential services” and relating to the orders made by Director General of Health Ashley Bloomfield under the Health Act 1956 on April March 26, April 3 and April 27, The New Zealand Herald reported.

“The government was trying to educate people about the health risks and transition them quickly to take actions that curtailed normal freedoms like staying at home to stop the spread of the virus,” Attorney General David Parker said after the verdict. “In the end, the measures taken by the government worked to eliminate Covid-19, save lives and minimise damage to our economy.”

On June 8, New Zealand had declared itself Covid-19 free. No new cases were reported in the South Pacific nation for 102 days. The entire country was put on a level two alert, which meant mass gatherings of over 100 people were prohibited and physical distancing norms were in effect.

The lockdown however was later reimposed after new cases surfaced in the country on August 11. Until that day, the only known cases of the virus in New Zealand since June 8 were 22 travellers who had returned from foreign shores and were kept in quarantine at the border.

On Monday, Prime Minster Ardern had announced that the elections would be delayed by four weeks to October 17 in view of the fresh coronavirus cases. So far, the country has reported 1,649 Covid cases and the toll stood at 22, according to the John Hopkins University data.

Follow today’s live update on the coronavirus here