A riot at Waikeria Prison in Waikato a year ago was a perfect storm waiting to happen, according to a clinical psychologist who has worked in prisons.
The incident started with a group of inmates lighting fires in a courtyard but soon escalated, with other prisoners being broken out of their cells and a number of men getting on to the roof.
The stand-off lasted six days before being peacefully resolved.
What was left behind was the utter devastation of the 100-year old remand prison, with damage estimates topping $25 million.
Dr Armon Tamatea spent 20 years working in prisons, 10 of them as a psychologist.
He is now a senior lecturer at Waikato University's school of psychology and is leading a research project called Nga Tūmanakotanga, which looks at prison violence.
He said a lack of ventilation, little natural light and problems with access to water all contributed to the riot.
"I suspect there won't be one single thing that would have contributed to this, but maybe a perfect storm of factors coming together that would have created the conditions that would have allowed or facilitated this kind of event to have happened."
He said riots like the incident at Waikeria were rare events.
"I think we have been quite lucky that we haven't had more of these kind of events in our history than we actually have.
"A good deal of that would probably be because we have had a lot of staff who have been on to it, but also ... there have been a number of efforts to try and mitigate unhealthy prison spaces, such as new builds."
During the Waikeria riot 200 prisoners had to be evacuated from their cells as fires burned around them.
Alan Whitley, industrial officer of the Corrections Association (the prison officers' union), described it as the biggest and most violent event ever in the New Zealand prison system.
''It took them all by surprise. [Corrections staff] worked really hard and fast and really quickly to try and contain what was happening, to try and get the prisoners to safety," he said.
Since the destruction of the building, prisoners and staff have had to be transferred to other jails. All hot meals are now cooked at Springhill Prison in North Waikato and taken to Waikeria.
Whitley said Waikeria was now a vastly different place.
"They only have only got low-security prisoners. A lot of staff from there are assisting at other prisons around the country that were short-staffed.
"There are staff working up at Springhill at the moment. So they are left in a little bit of a quandary of what was going to happen. They were staffed for quite a large prison, half of it disappeared."
The construction of a new 500-bed facility was well under way at the time of the riot and is due to open in 2023.
Could a similar riot happen again in a New Zealand prison?
Whitley cannot rule it out.
"Prisons aren't nice playgrounds. They can be violent places. Staff show a lot of courage doing what they do on a daily basis, so you never know what is going to happen to be honest."
Tamatea agrees. "Prisons, especially high-security sites - let alone remand units - contain folk that aren't run of the mill people necessarily with run of the mill issues.
"Remand units in particular are quite susceptible to specific kinds of stress. For instance prisoners on remand face a lot of uncertainty. On top of the uncertainty of being in a prison environment there is life-plans and adjustments that need to be kind of considered."
A total of $1.3m was paid out to prisoners and staff at Waikeria who lost belongings in the prison fire.
Seventeen prisoners have been charged in relation to the riot and protest and they are due back in court in March.
An independent report from the Prison Inspectorate is yet to be released.