AUCKLAND, New Zealand — When the man grabbed one of the knives at a Countdown supermarket in West Auckland on Friday and began stabbing shoppers, the police were just outside.
They had followed him there. They had, in fact, been following him for months, since he was released from prison. Officials at the highest levels of New Zealand’s government knew about the man, said to be an Islamic State sympathizer — including Prime Minister Jacinda Ardern, who had received briefings about his case.
He was considered so dangerous that on the very day he wounded seven people at the supermarket and was shot dead by the police, Ms. Ardern’s government had been trying to expedite counterterrorism legislation in Parliament, to give law enforcement officials a legal way to take him back into custody.
“Agencies used every tool available to them to protect innocent people from this individual,” Ms. Ardern said of the man, whose name had yet to be released, at a Saturday news conference. “Every legal avenue was tried,” she added.
Still, the political opposition and some members of the public are asking why the man, a Sri Lankan national in his 30s, had not been deported if the authorities considered him a danger to the public. Three of the people wounded in the attack were in critical condition on Saturday.
“This is an Islamic State-inspired terrorist who, for some unknown reason, was in the N.Z. community,” Judith Collins, the leader of the opposition, said in a post on Twitter on Friday night. “Questions need to be asked and answered as to how this violent offender, motivated by hatred, was allowed free into the community.”
New Zealand, a country with low and declining crime rates far from the flash points of global terror, was once unaccustomed to such questions. But they grew in volume after an anti-Muslim terrorist murdered 51 people at two mosques in the city of Christchurch in 2019.
Now the country, like others, is grappling with the trade-offs between monitoring suspects and preventing terrorist attacks, and with concerns about containing the power of the government and the police to surveil and detain people based on suspicions.
Though the supermarket attacker’s name was still being withheld, more information about him became available after a court lifted a suppression order Friday night.
Ms. Ardern said on Saturday that the man had been arrested at the Auckland airport in 2017 on suspicion of planning to travel to Syria to join the Islamic State militant group, which then controlled parts of Syria and Iraq.
He spent three years in prison on a variety of charges, including assaulting a corrections officer, before being released in July. Ms. Ardern said that as his release date drew near, officials became increasingly concerned. She said he could not be committed to a mental health facility, having refused a psychological evaluation.
In late August, she said, Police Commissioner Andrew Coster and other officials recommended speeding up amendments to New Zealand’s counterterrorism laws that were already working their way through Parliament. The legislation, initially introduced as part of a wider review of the antiterror laws, includes a provision that would make planning a terror attack a criminal offense — plugging a gap in the law that a court called “an Achilles’ heel” in a ruling on the man’s case in July 2020.
“Within 48 hours of these discussions, the minister of justice contacted the chair of the select committee with the intention of speeding that law change up,” Ms. Ardern said. “That was yesterday, the same day the attack happened.”
Mr. Coster, the police commissioner, said at the news conference that the man had been under constant surveillance since his release, with as many as 30 officers sometimes monitoring his behavior. He said the man believed he was being watched and had confronted members of the public, asking if they were following him.
Mr. Coster said there had been “nothing unusual” about the man’s activities on Friday before he arrived at the supermarket. Armed officers were outside the store when the attack began — an indication of how dangerous the man was believed to be, as the police in New Zealand rarely carry guns.
Mr. Coster said the officers had not followed the man into the supermarket because, under Covid restrictions, relatively few people were inside. That meant the officers would have been much more conspicuous and might have been compromised, he said. A member of the elite Special Tactics Group killed the man less than three minutes after the attack began, he said.
Ms. Ardern praised the police response. “This was a highly motivated individual who used a supermarket visit as a shield for an attack,” she said. “That is an incredibly tough set of circumstances.”
Countdown and three other New Zealand supermarket chains said after the attack that they would suspend the sale of sharp knives. Countdown said it would also temporarily stop selling scissors.
Ms. Ardern said her government intended to pass the counterterrorism amendments by the end of this month. Opposition lawmakers have said they would support the changes, even as they called for more information about why the attacker had not been deported.
Certain details about the man’s immigration status could not yet be released, Ms. Ardern said. She also said his name could not be disclosed until at least Saturday night, to give his family time to challenge the court’s decision to lift its suppression order.
Ms. Ardern said she would not use the man’s name in public, a rule she has applied to the Christchurch gunman. “No terrorist, whether alive or deceased, deserves their name to be shared for the infamy they were seeking,” she said.