Entrepreneur and Tesla CEO Elon Musk (Eric Piermont/AFP/Getty Images)

Electric carmaker Tesla and leading rooftop solar installer SolarCity announced Monday that they had agreed to a $ 2.6 billion merger, moving to create a company that combines household renewable energy, battery storage and cars that are able to run on it.

“Solar and storage are at their best when they’re combined,” the companies said in a joint statement. The original offer by Tesla to purchase SolarCity was announced in June.

Elon Musk, chief executive of Tesla, is also chairman of Solar City. The deal will be all stock, in which SolarCity shares are valued at $ 25.37 and shareholders receive 0.11 shares of Tesla for each of their SolarCity shares. It would close in the final quarter of 2016 and is subject to regulatory approval and votes by shareholders.

The companies said they could reap the benefits of $150 million in cost synergies in the first year after the deal closes.

“This is really all part of solving the sustainable energy problem,” Musk said on a conference call Monday. “That’s why we’re all doing this, is to try to accelerate the advent of a sustainable energy world, and I think this is an important step in that direction.”

He also noted that the combined company will be marketing solar and battery combinations to the 3 million customers who visit Tesla’s 190 stores.

“It’s going to be very clear that this combination of solar combined with storage will be able to provide energy at a lower cost than traditional forms of energy,” Lyndon Rive, SolarCity chief executive, said during the call.

Skeptics have questioned the deal, and Tesla stock fell when it was announced in June. But Musk has defended it strongly as part of a broader long-term vision for clean energy, or his “master plan.”

A key linchpin to connecting the selling of rooftop solar and the selling of electric cars was announced last year when Tesla unveiled the Powerwall, a home battery, to intense interest. SolarCity then promptly said it would install Powerwalls alongside some of its home solar arrays.

“We want to have batteries deployed with all of our solar power systems by the end of the decade,” Peter Rive, SolarCity’s co-founder, told me then.

And of course Tesla’s Gigafactory, a gigantic, solar-covered installation in the Nevada desert, is designed to mass produce lithium-ion batteries (used in electric vehicles and home storage systems) to try to drive down costs and dramatically increase volumes.

Monday’s announcement by the companies was accompanied by a graphic showing one underlying motivation — spiking concentrations of carbon dioxide, now well past 400 parts per million in the atmosphere.

It’s far from clear whether the world will address this problem fast enough, or precisely which technologies will benefit from the change, but Tesla and SolarCity have just made a strong bid for a role in that future.

Or as Musk recently put it in a blog post about his “master plan,” getting energy in a sustainable way is “not some silly, hippy thing — it matters for everyone.”