New Zealand police on Friday shot and killed a "violent extremist" who was known to authorities, Prime Minister Jacinda Ardern said, after he stabbed and wounded at least six people in a supermarket.

The attacker, a Sri Lankan national who had been in New Zealand for 10 years, was inspired by the Islamic State militant group and was being monitored constantly, Ardern said.

"A violent extremist undertook a terrorist attack on innocent New Zealanders," Ardern told a briefing.