Landcorp will stop using controversial palm kernel on its farms from June next year.
Palm kernel expeller (PKE) - a by-product of the palm oil industry - is used as a supplementary animal feed, mostly by the dairy industry.
The product has been linked to the destruction of rainforests and loss of biodiversity in South East Asia.
New Zealand imported more PKE than ever last year, bringing in 1.95 million tonnes of the product in the 12 months to June 2015.
But Landcorp - the state-owned farm comapny - announced it would switch to alternative, locally-sourced feeding supplements.
Chief executive Steven Carden said all Landcorp farms would transition to alternative feed supplements by June 2017.
"One of the real points of difference for New Zealand farming is our ability to grow grass and produce grass-fed animals. There is a growing interest in this food globally," he said.
"Landcorp wants our partners and customers to know they can trust that we farm sustainably and care for the environment. We need to anticipate shifting consumer expectations on how their food is produced and change how we farm accordingly."
The company expected removing PKE from its farms would be virtually cost-neutral, Mr Carden said.
"We think there are significant longer term gains in terms of our ability to attract new premium customers."
About 40 percent of Landcorp's farms currently used PKE.
It was not used on any livestock farms and a few of the company's dairy farms were already PKE-free.
In the 2013/14 financial year - when Landcorp's use of the supplement peaked - it represented about 6 percent of the average total diet of a dairy cow.
That figure was reduced to less than 4 percent in the last financial year.
Greenpeace said it was a significant turnaround for rainforest protection and for the way New Zealand farms.
The environmental lobby group has been campaigning for seven years to phase out PKE.
"PKE has been a big part of the intensive dairy model that has failed our rivers, land, climate and farmers," Greenpeace spokesman Grant Rosoman said.
"It's great to see a major player like Landcorp turning its back on that model and moving back towards traditional New Zealand pasture-based farming. Next we want to see Fonterra follow suit."
Last year, Fonterra asked its farmers to restrict the use of the product.