The life of the Tiwai Point aluminium smelter has been extended by 20 years.
Smelter owner, Rio Tinto, and electricity company, Meridian, have struck a supply deal which is good news for Southland's economy.
The new contract will also prop up the national power supply when the hydro lakes run low.
It's another 20 years for Tiwai, and a massive relief for Southland.
"It's been frustrating because we have investors in housing and renewable energy who want to invest but they need some certainty about what's happening with Tiwai," said Invercargill Mayor Nobby Clark.
Not only is the smelter Southlands' biggest employer, it's also New Zealand's largest electricity user.
A deal with Meridian was to run out later this year, but new terms have been reached.
Meridian CEO Neal Barclay called it a "huge day".
"None of us involved in this negotiation wanted to see the closure of the smelter on our watch," he said.
Under new contracts with Meridian, Contact and Mercury, the smelter can be asked to reduce production so electricity can be redirected to keep the lights on in up to 250,000 households.
That amount is about a quarter of the storage that was proposed under the now-scrapped Lake Onslow project.
It also means less coal burned at Huntly Power Station.
"It removes a lot of uncertainty and what it means is that we can now get on with investing in renewable energy and grow our green economy. I think this is fundamental to our future," Barclay said.
It won't help in an emergency as it takes 30 days to ramp down the smelter lines.
But Tiwai already has another deal where it can slightly reduce its energy use to help during cold snaps like it did during May.
Now there is long-term certainty, no Government undertakings or bailouts will be on the table.
"Because of the arrangement that's been sealed today, that won't be necessary," said Finance Minister Nicola Willis.
Not quite sealed - the contract has to be approved by the Electricity Authority before it becomes live in July.