Immigration officials spent years trying to deport the terrorist responsible for Friday's stabbing rampage at an Auckland Countdown supermarket. Their efforts were ultimately unsuccessful.
It's a process which Jacinda Ardern said was "incredibly disappointing and frustrating", raising alarm at the man's ability to stay in New Zealand just two months ago.
On Saturday night the terrorist was named as Ahamed Aathil Mohamed after his court ordered name suppression lapsed. He was shot dead by police officers after injuring seven people, three critically, at the LynnMall supermarket.
Authorities had exhausted avenues attempting to keep the terrorist detained while discussions of deporting him were ongoing, but the law kept them from doing so, Ardern said.
"Agencies were concerned about the risk this individual posed to the community. They also knew he may be released from prison and that his appeal through the Tribunal, which was stopping his deportation, may take some time," Ardern said in a statement late Saturday night.
The 32-year-old Sri Lankan national arrived in the country on a student visa in 2011.
His appeal for refugee status was denied in 2012, as Immigration New Zealand ruled his claim was "lacking in credibility."
However, he successfully appealled to the Immigration and Protection Tribunal the following year.
By 2016, the terrorist came to the attention of police and New Zealand's Security Intelligence Service due to concerning things he was posting online.
"In the course of these investigations, Immigration NZ were made aware of information that led them to believe the individual's refugee status was fraudulently obtained. The process was started to cancel his refugee status, and with it, his right to stay in New Zealand.
"In February 2019, Immigration NZ cancelled his refugee status. He was served with deportation liability notices," Ardern said.
"He was still in prison at this time and facing criminal charges. For a number of reasons, the deportation appeal could not proceed until after the conclusion of the criminal trial in May 2021.
"In the meantime, agencies were concerned about the risk this individual posed to the community. They also knew he may be released from prison, and that his appeal through the Tribunal, which was stopping his deportation, may take some time."
Ardern said Immigration New Zealand had investigated whether the terrorist could be kept in prison under the Immigration Act while his appeal was heard, with no luck.
"It was incredibly disappointing and frustrating when legal advice came back to say this wasn't an option."
Advice given to Immigration New Zealand from the Crown Law said he would likely be considered a "protected person" due to the situation in Sri Lanka and subsequent treatment he would endure upon his return.
As a result, Immigration New Zealand decided he could not be detained while he awaited his deportation appeal.
It was shortly after his release that police began closely monitoring his actions.
Jacinda Ardern noted it had been a "frustrating process", with ministers having sought advice for deporting the man since 2018.
She had expressed concern to officials just two months ago about the man's ability to remain in the country under current laws.
"I asked for work to be undertaken to look at whether we should amend our law, in the context of our international obligations.
"Ultimately, these timelines show that Immigration New Zealand from the beginning have sought to deport this individual and were right to do so," Jacinda Ardern said.