The terrorist responsible for the 2019 Christchurch terror attack obtained his firearms licence in a system where police staff were stretched, not checking the full range of risks a licence holder might pose, and where they could manufacture their own military-style semi-automatics in a completely unregulated way.
The inquest into the Christchurch terror attack where 51 worshippers at Al Noor Mosque and Linwood Islamic Centre were murdered on 15 March 2019 has re-convened for its second phase.
The terrorist's ability to obtain the guns he used in the attack is being examined.
Michael McIlraith, who was police's national lead for firearms at the time of the attack, is giving evidence in the coroner's court.
He told the inquest the firearms service was often not resourced enough to meet demands, putting significant pressure on staff.
Every 10 years, there was a four-year period where demand would double, McIlraith said, as licences were up for renewal.
Training of new staff was left to existing arms staff, on the job, working on files as they presented.
There was no nationally available material, meaning the Arms Act was interpreted and applied differently by arms staff across the country.
At the time the terrorist obtained his licence in 2017, military-style semi-automatic (MSSAs) rifles could only be possessed by those with a more restrictive E-category firearms licence. But much of what differed from sporting centrefire semi-automatic rifles and MSSAs was cosmetic and did not affect their use or lethality.
Crucially, the changes the terrorist made to his rifle - the use of high-capacity magazines - was not adequately regulated and he was able to buy those magazines without an E-category licence.
That increased how many rounds he could fire before having to reload the firearms.
McIlraith said police did not have visibility on those who had made such changes the terrorist had made to his rifles.
McIlraith said the process of obtaining a firearms licence in 2017 included attending a 2-3 hour long safety course and having two referees - usually a relative and independent person - interviewed before the applicant was interviewed themselves and showed police staff a satisfactory place to store the weapons at their residential address.
If the applicant was found "fit and proper" to hold a licence, that decision would be made by an arms officer or supervisor and a plastic licence would be issued and posted to them.
In the terrorist's case, his sister and an independent person were given as referees, but given his sister did not live in New Zealand and the referee needed to be interviewed in person, she was negated as a possible referee.
He then gave another independent referee who was accepted by police as a replacement.
The two referees were interviewed after the terrorist himself, which was not standard practice but did happen at times, McIlraith said.
In the days after the attack, McIlraith was asked to look over the terrorist's file and determine whether the firearms licence should have been granted.
In his view, the two referees being interviewed after the terrorist made no difference to the final decision as no risks were raised.
But months later, McIlraith said he was made aware of who the two referees were and the "exact nature" of the relationship and frequency of contact.
Given one of the referees was a gaming friend, most of their interactions were done online.
The second referee, the gaming friend's parent, was "even less suitable" as he had only met the terrorist briefly during a small number of visits to the family home.
At the time, McIlraith said the vetting forms simply asked how long the referee had known the applicant - and there were no follow-up questions to ask about frequency or manner of contact.
While police have accepted the referees were not suitable as they did not know the terrorist well enough, the vetter had done what was standard for them to do at the time.
But it had highlighted a lack of training and assurance processes to determine any unsuitability in a referee.
There had also been no training for arms staff to identify any racist or extremist views, McIlraith said.
This has since been updated and questions on these views remain in the applicant and referee questionnaires.
'Bizarre' that family not spoken to in application process - lawyer
A lawyer representing families and victims questioned McIlraith on the "bizarre" decision not to question the terrorist's family in the application process.
Kathryn Dalziel said the terrorists' application raised a number of red flags - including that he had recently moved to New Zealand, did not know many people, and had not been able to hold a job for the past seven years.
She questioned McIlraith on why speaking to family members was important until they lived overseas.
McIlraith said it was important to speak to family - especially a spouse or parent - but the operational settings at the time did not enable overseas referees.
Dalziel said she found it "astounding" that procedurally, it was okay not to speak to family about an application for a gun that could be "used to kill themselves or someone else".
"It's bizarre."
Dalziel asked if there was discretion at the time to use an audio link, for example, to speak to family members overseas.
McIlraith said that potentially could have been done but whether it was considered was another issue.
He maintained his response that at the time, the referees used were considered appropriate, no risks had been raised and the licence was appropriately given.
The second phase of the inquest is set down for three weeks, with about 15 witnesses expected to be called.