"We found that lower temperature caused the glaciers to advance, rather than increased precipitation as previously thought.
"These periods of reduced temperature affected the entire New Zealand region, and they were significant enough for the glaciers to re-advance in spite of human-induced climate change."
Mackintosh said the climate variability, which includes the cooler years, still reflected a climate that's been modified by humans.
"It may seem unusual. This regional cooling during a period of overall global warming but it's still consistent with human-induced climate change."
The temperature changes were a result of variability in the climate system that was specific to New Zealand, he said.
"New Zealand sits in a region where there's significant variability in the oceans and the atmosphere, much more than many parts of the world.
"The climate variability that we identified was also responsible for changes in the Antarctic ice sheet and sea ice during this period."
They found New Zealand glaciers that advanced had certain characteristics, including specific elevation and geometry.
"Franz Josef Glacier actually regained almost half of the total length it had lost in the twentieth century.
"However, Haupapa/Tasman Glacier, New Zealand's largest glacier, which has about a third of all of New Zealand's ice volume, continued to retreat.
"Because of that, New Zealand glaciers lost mass overall over this period."
The study, funded by a core Niwa project "Climate Present and Past", used computer modelling to understand the drivers of glaciers.
The model was tested using more than a decade of field observations of glaciers in the Southern Alps, and a 30-year record of glacier photographs from the Niwa "End of Summer Snowline" programme.
Mackintosh said, although glaciers advancing sounded promising, the future "doesn't look good" for New Zealand's glaciers.
"Franz Josef Glacier has already retreated more than 1.5km since the end of the advance in 2008.
"New Zealand's glaciers are very sensitive to temperature change.
"If we get the two to four degrees of warming expected by the end of the century, our glaciers are going to mostly disappear.
"Some may experience small-scale advance over that time due to the regional climate variability, but overall they will retreat."
Other authors of the study included Victoria University's Dr Brian Anderson and Professor James Renwick, Niwa's Dr Andrew Lorrey and Dr Sam Dean and visiting student Prisco Frei from ETH Zurich.