KiwiRail is to buy 57 new engines that will be manufactured in Spain for its South Island operations.
It signed a $403 million contract with the Swiss-owned Stadler for low emission diesel locomotives to replace its ageing fleet.
KiwiRail chief executive Greg Miller said the new engines would provide reliable services, be more energy-efficient and economical to operate and be able to haul bigger trains.
"These are the latest-generation locomotives, which will set up KiwiRail's South Island freight business for many decades ahead."
He described them as "state of the art", with a significant reduction in emissions.
The new engines replace a fleet, which has some locomotives close to 60 years old, and will enter service from 2024.
Miller said the KiwiRail tender attracted four of the world's top engine makers.
The engines have been designed to suit local conditions after consultation with the Rail and Maritime Transport Union, which backed the purchase and supplier.
"This is a quality product which will help KiwiRail to provide a safe, sustainable and reliable service to Kiwi businesses well into the future," general secretary Wayne Butson said.
KiwiRail's most recent engines have come from China and have been criticised for poor and uneven performance.