Prime Minister Jacinda Ardern said the incident was a "terrorist attack" carried out by a Sri Lankan national who was under police surveillance.
The man, who has not been officially named, was a supporter of the Islamic State (IS) terrorist group, she said.
Police killed the man within 60 seconds of the attack on Friday.