The High Court has thrown out a bid to mine ironsands from the bottom of the ocean off the coast of South Taranaki.
Trans Tasman Resources had earlier won approval to do so in the second of two hearings before the Environmental Protection Authority (EPA).
But several iwi and environmental groups challenged this decision in the High Court.
In a judgement just handed down, Justice Peter Churchman condemned what he called a narrow interpretation of the law by the EPA's Decision Making Committee (DMC).
He ruled that was inconsistent with the purpose of the Exclusive Economic Zone Act.
It was also inconsistent with a policy of precautionary decision-making.
This meant that where information was uncertain or inadequate about the impacts of a scheme, then a marine consent authority should err on the side of caution and environmental protection.
The case involved an application by Trans-Tasman Resources to mine for iron ore in a 66sqkm area of seabed off the Taranaki Bight.
The company intended to dig up to 50 million tonnes of sand each year, extract the iron ore from it, and dump the residue on the sea floor.
The scheme would create 300 jobs and add $160 million to New Zealand's GDP, the company said.
Trans-Tasman lost its first application to do this after a hearing before the EPA.
But it resubmitted its application and won through a second time around.
Several groups immediately announced they would appeal.
This included the lobby group Kiwis Against Seabed Mining and some Taranaki iwi.
Kiwis Against Seabed Mining said appealing the decision was "the only responsible route".
The original application was opposed by fishing groups as well as iwi and environmentalists because undersea mining would stir up sediment and leave it suspended in the sea, at a cost to the living environment for fish.
Trans-Tasman Resources denied that this impact would be significant, and the size of the mined area would be small compared with the extent of the surrounding ocean.
In addition, this was hardly a pristine environment, due to the passage of ships and drilling for oil and gas.
Justice Churchman's comments were decisive.
"The narrow interpretation [of the EEZ Act] is inconsistent with the purpose of protecting the environment from pollution by regulating or prohibiting the discharge of harmful substances," he wrote.
"It was also inconsistent with the obligation that where information available is uncertain or inadequate, a marine consent authority must favour caution and environmental protection.
"The appeal is allowed and the decision of the DMC is quashed. The matter is referred back to the DMC for reconsideration, applying the correct legal test."