Fire crews from Whanganui, Taihape and Waiouru were called to an incident involving a freight train at Utiku, near Taihape, on Thursday.
Senior station officer Aaron Summerhays said the train was transporting a tank that began venting liquid nitrogen. Liquid nitrogen creates clouds of vapour when it is exposed to air.
"There were a couple of houses nearby that were evacuated until we could identify the substance and know what we were dealing with," Mr Summerhays said.
"We cordoned off the area and got specialist advice on how to stop the venting which was happening through a pressure relief valve. Once we had reduced the venting and were happy the product was stable, the train continued on to its destination."
It was a long evening for the Whanganui crews who were called out just after 4.30pm and were back at base about 10.30pm. The hazardous substances truck from the Whanganui station attended the incident.