A man, inspired by ISIS ideology, who entered a New Zealand supermarket and stabbed at least six people was a “violent extremist” known to the police, Prime Minister Jacinda Ardern has said.

The man was shot and killed by police within 60 seconds of beginning his attack, which wounded at least six people at a Countdown store in the city.

The man was a Sri Lankan national and had been living in New Zealand since 2011.

“A violent extremist undertook a terrorist attack on innocent New Zealanders,” Jacinda Ardern told a briefing on Friday.

He had been known to multiple agencies since 2016, with Ms Ardern confirming she had been personally aware of the individual – adding that she was personally gutted to hear what had happened.

She said: “This was someone who was known to our national security agencies and was of concern and was being monitored constantly. There are very few that fall into this category.”

Police following the man thought he had gone into the New Lynn supermarket to do some shopping but he pulled out what one witness described as a large knife and started stabbing people.

More on Jacinda Ardern

“There’s someone here with a knife … he’s got a knife,” a woman is heard saying in one video, posted online after the attack.

Another recorded the sound of ten shots being fired in rapid succession.

“We were doing absolutely everything possible to monitor him and indeed the fact that we were able to intervene so quickly, in roughly 60 seconds, shows just how closely we were watching him,” Police Commissioner Andrew Coster said.

Described as a “lone wolf”, Ms Ardern said the attacker was a “supporter of ISIS” and inspired by extremist ideology.

The man was not allowed to be kept in prison by law, she said.

Of the six wounded people, three were in critical condition, one in serious condition and another in moderate condition, the St John Ambulance Service said in a statement to Reuters.

Ms Ardern said any backlash against the Muslim community “would be wrong”, and said the attacker “is who is responsible, no one else”.

“What happened today was despicable, it was hateful, it was wrong. It was carried out by an individual, not a faith,” she added.

The security in the country will remain at a medium level.

New Zealand has been on alert for attacks since a white supremacist gunman killed 51 people at two mosques in the city of Christchurch on March 15, 2019. In May, four people were stabbed in a supermarket in Dunedin on New Zealand’s South Island.

Auckland is on a strict lockdown as it battles an outbreak of the coronavirus. Most businesses are shut and people are generally only allowed to leave their homes to buy groceries, for medical needs, or to exercise.