Elon Musk has agreed to build what is being hailed the "world’s largest virtual power plant", by rolling out solar panels and Tesla batteries to 50,000 homes in South Australia.

The scheme, which will be completed over the next four years, will see any excess energy stored in each battery fed back into the grid to provide power to the rest of the state whenever required.

The South Australian government claims participating households will generate a total of 250MW of electricity – about half as much energy produced by a typical coal-fired power station.

In an initial trial, which has already begun, a 5kW solar panel system and a 13.5kWh Tesla Powerball 2 battery will be installed free of charge in 1,100 state-owned properties.

Future sales of electricity are expected to cover the costs.

Tesla’s enormous battery in Southern Australia

If the trial is successful, a further 24,000 public housing properties will receive the systems before a full rollout to private homeowners who want to participate in 2019.

According to the state government, households involved in the scheme can expect to see their energy bills lowered by 30 per cent, and even those not taking part will benefit from lower costs and fewer blackouts.

The government claims individual energy systems will generate a “significant” proportion of each household's electricity needs, day and night. It also says the system as a whole will produce 20 per cent of the entire state’s daily energy requirements,

LA to San Francisco in 30 minutes: Paypal founder Elon Musk unveils 800mph Hyperloop 'trains' Show all 6 1 /6 LA to San Francisco in 30 minutes: Paypal founder Elon Musk unveils 800mph Hyperloop 'trains' LA to San Francisco in 30 minutes: Paypal founder Elon Musk unveils 800mph Hyperloop 'trains' hyperloop.jpg Hyperloop tubes would be mounted above ground on columns, and inside them would be pods five miles apart leaving every 30 seconds LA to San Francisco in 30 minutes: Paypal founder Elon Musk unveils 800mph Hyperloop 'trains' hyperloop-2.jpg A sketch of billionaire Elon Musk's proposed "Hyperloop" transport system Reuters LA to San Francisco in 30 minutes: Paypal founder Elon Musk unveils 800mph Hyperloop 'trains' hyperloop-3.jpg A sketch of billionaire U.S. entrepreneur Elon Musk's proposed "Hyperloop" transport system Reuters LA to San Francisco in 30 minutes: Paypal founder Elon Musk unveils 800mph Hyperloop 'trains' hyperloop-4.jpg Streamlines for capsule traveling at high subsonic velocities inside Hyperloop spacex.com LA to San Francisco in 30 minutes: Paypal founder Elon Musk unveils 800mph Hyperloop 'trains' hyperloop-5.jpg An image of the Hyperloop passenger capsule with doors open at the station spacex.com LA to San Francisco in 30 minutes: Paypal founder Elon Musk unveils 800mph Hyperloop 'trains' hyperloop-6.jpg Hyperloop capsule in tube cutaway with attached solar arrays spacex.com

An initial A$32m (£18m) will be provided from government grants and a renewable technology fund to get the project off the ground. The total A$800m (£450m) cost is expected to be funded by private investors.

The move comes just two months after Tesla switched on the world’s biggest lithium ion battery to help stabilise Australia’s shaky power infrastructure.

Tesla won a bid in July to build the 129-megawatt hour battery for South Australia, which expanded in wind power far quicker than the rest of the country, but has suffered a string of blackouts over the past 18 months.

Critics of South Australia’s renewable energy push have argued Tesla’s battery is a “Hollywood solution” in a country that still relies on fossil fuels – mainly coal – for two-thirds of its energy.