SYDNEY (Reuters) - South Australia, the country's most renewable-energy dependent state, outlined plans on Tuesday to spend A$510 million ($385 million) to keep the lights on, just four days after Tesla Inc TSLA.O boss Elon Musk offered to save the state from blackouts by installing large-scale battery storage.

Slideshow ( 7 images )

The plan includes A$150 million to encourage the development of a 100 megawatts of battery storage, possibly from Musk or from local providers. The state will also build and operate a new A$360 million 250-megawatt gas power plant to stabilize its electricity system.

The South Australia government came up with the emergency plan after a state-wide blackout last September during a storm left homes and businesses in the dark for up to eight hours and paralyzed some industries for up to two weeks.

“Today, South Australia takes hold of its energy future. We have a national electricity market which is failing not only South Australia but failing the nation,” state Premier Jay Weatherill said in a statement.

The state, which relies on wind for about a third of its power capacity, has become vulnerable to outages and soaring prices as it does not have enough back-up power when the wind is not blowing.

South Australia's last coal-fired power station shut down last May, as it was making losses, and France's Engie SA ENGIE.PA mothballed one of two units at a gas-fired power plant for the same reason.

On the batteries front, Weatherill said he was speaking to a range of providers.

“We want as much local content as possible,” he told a news conference. “We also need to put in the balance the reputational effect of attracting an international player of the size of Elon Musk to South Australia. “

Weatherill spoke to Musk on Saturday after Australian tech entrepreneur Mike Cannon-Brookes said he would help raise funding and political support for the Tesla chief’s offer to supply 100 megawatt-hours of batteries for $25 million within 100 days of signing a contract, or provide it free.

“Over the coming days Tesla are assessing with stakeholders how best to deliver on this exciting opportunity for the benefit of the Australian energy market,” a Tesla spokesman said.

South Australia released its plan a day ahead of a crisis meeting called by Prime Minister Malcolm Turnbull with the heads of Australia’s gas producers to find ways to boost gas supply, crucial for power plants and manufacturers.

Federal Energy Minister Josh Frydenberg slammed South Australia’s plan saying it could drive up power prices and undermine national electricity market rules.

Top global miner BHP Billiton BHP.AXBLT.L, which lost $105 million at its Olympic Dam copper mine after the blackout last September, welcomed the state's effort to boost energy security, but warned it could have "pricing implications" and affect expansion plans.

“South Australian business and residents cannot afford a repeat of the energy issues experienced over the past eight months, and we look forward to immediate steps being taken which will provide greater energy security for the State before the end of the year,” a BHP Billiton spokesman said.