The deal was announced by the South Australian Premier Jay Weatherill on Sunday. The state is scheduled to hold elections in March.
The government said that the project would begin with a trial of 1100 public housing units.
The aim is to fit 50,000 homes with 5kW solar arrays and 13.5kWh Tesla Powerwall 2 battery systems, which will result in at least 650MWh of energy storage capacity.
Weatherill said in a TV interview: ""We lead the world in renewable energy with the world's largest battery, the world's largest solar thermal plant and now the world's largest virtual power plant."
South Australia has already installed the world's largest battery, also from Tesla, after a number of blackouts last year when energy prices rose sharply.
A Tesla statement said: "When the South Australian Government invited submissions for innovation in renewables and storage, Tesla’s proposal to create a virtual power plant with 250 megawatts of solar energy and 650 megawatt hours of battery storage was successful.
"A virtual power plant utilises Tesla Powerwall batteries to store energy collectively from thousands of homes with solar panels. At key moments, the virtual power plant could provide as much capacity as a large gas turbine or coal power plant."
The company plans to finish installation in the 50,000 homes by 2022.