A train driver was attacked as he passed through Feilding in the early hours this morning and had to lock himself in the cab for safety.
Shortly before 3am the KiwiRail locomotive engineer was driving the train alone in Feilding, when he noticed something amiss at the rear of the train.
After fixing the fault he was attacked by two people who had boarded the second locomotive illegally.
KiwiRail acting chief executive Todd Moyle said the driver was able to escape and lock himself in the cab.
The offenders threw rocks at the locomotive, smashing the front window.
"This is completely unacceptable, cowardly behavior and KiwiRail will not tolerate it," Moyle said.
"We are working with police and will use every legal means open to us to apprehend and punish the offenders.
"Not only did they put themselves at risk by boarding a train, but they also posed a risk to members of the public and KiwiRail staff.
"Thankfully, in this instance, the locomotive engineer was not seriously injured."
The man was off work to recover and was being supported by his family and KiwiRail.
Moyle said because of the health and safety risk to its staff, trespassers would not receive any leniency from KiwiRail.
Police were speaking to one person in regard to the incident and seeking a second.
"Our main concern is for our staff member at the moment and we will continue to work with police," Moyle.