Tesla is buying SolarCity for $2.6 billion

Elon Musk. AP Photo/Jack Plunkett SolarCity, a maker of solar panels, has agreed to a merger with the electric-car maker Tesla, according to a post on SolarCity's official blog.

Tesla made an all-stock offer for SolarCity on June 21. According to the post, the enterprise value of the deal will be $2.6 billion.

The deal values each share of SolarCity at $25.37, according to the post. As of the close on Friday, SolarCity shares were trading at $26.70.

The deal combines two of entrepreneur Elon Musk's public firms to create what the SolarCity post called "the world's only vertically integrated sustainable energy company."

"Now is the right time to bring our two companies together: Tesla is getting ready to scale our Powerwall and Powerpack stationary storage products and SolarCity is getting ready to offer next-generation differentiated solar solutions," the post from SolarCity said.

"By joining forces, we can operate more efficiently and fully integrate our products, while providing customers with an aesthetically beautiful and simple one-stop solar + storage experience: one installation, one service contract, one phone app."

According to the post, SolarCity has a 45-day period, which will end September 14, to solicit counteroffers.

The acquisition comes after a tough year for SolarCity in which the stock tumbled from a peak of $60.17 on August 15 of last year to as low as $16.67 on February 11. The company has also drawn criticism for its high level of cash burn, and its model of leasing panels has come under fire from investors, most notably short seller Jim Chanos.