Tesla wants to put its car and energy storage businesses under one solar-powered roof.

Tesla said Monday it will buy solar panel maker SolarCity Corp. in an all-stock deal worth $2.6 billion. The deal must still be approved by the government and shareholders at both companies. It’s expected to close in the fourth quarter if it goes through.

Plus, on Monday Tesla unveiled a video of an autonomous robot working at its huge battery factory in Nevada.

In a live streamfrom the Tesla Gigafactory Tour (also watched by nearly 30,000 people at YouTube), Tesla noted:

“See the robots! And be greeted by them!”

(Watch the video at: https://www.youtube.com/watch?v=f0P1Ikyz8To )

“Tesla’s mission is to accelerate the world’s transition to sustainable energy. To achieve that goal, we must produce electric vehicles in sufficient volume to force change in the automobile industry. With a planned production rate of 500,000 cars per year in the latter half of this decade, Tesla alone will require today’s entire worldwide production of lithium ion batteries. The Tesla Gigafactory was born of necessity and will supply enough batteries to support our projected vehicle demand,” Tesla noted.

The 13-year-old Tesla currently makes two luxury vehicles — the Model S sedan and Model X SUV— as well as Powerwall and Powerpack energy storage units for homes and businesses.

The company said Monday that a tie-up with SolarCity would create a one-stop shop for cleaner energy. With one service call, customers could get their solar panels installed and connected to a Powerwall, which preserves energy for later use. Users could also get the system hooked up to chargers for one of Tesla’s vehicles.

“This is really all part of solving the sustainable energy problem,” said Elon Musk, the chairman and biggest shareholder of both companies, during a conference call.

But some have questioned the wisdom of the deal, which combines two money-losing companies that already have a lot on their plates.

Tesla is working feverishly on its new, lower-cost Model 3 sedan, which is due out by the end of next year, as well as pickups, electric buses and semi-trucks. It’s in the midst of building one of the world’s largest factories in Nevada to make batteries. And it’s under investigation by the government after the semi-autonomous Autopilot system in its Model S failed to prevent a fatal crash in Florida.

Ten-year-old SolarCity is the top provider of residential solar panels in the U.S., and installs about one-fifth of all commercial solar panels. But the company said Monday that it experienced lower-than-expected residential bookings in the first half of the year, so it’s reducing its full-year guidance for megawatts installed.

Others have questioned the conflicts of interest in the deal. Musk owns a 26 percent stake in Tesla Motors Inc., based in Palo Alto, California, and a 22.5 percent stake in SolarCity Corp., which is based in nearby San Mateo, California. Musk’s cousins, Lyndon Rive and Peter Rive, run SolarCity.

But Musk said the companies have synergies they can’t take advantage of unless they’re combined.

“The point of the merger is to get rid of the conflicts,” he said. “Until then it’s very limited what we can do unless we are one company.”

Musk said he believes the companies could save $150 million to $200 million in the first year alone by streamlining manufacturing, sales and service. Customers could learn about SolarCity products at Tesla’s 190 stores, for example, and save on installation costs because they’d be done more efficiently. Tesla also would give SolarCity access to international customers.

SolarCity’s stock slid more than 8 percent to $24.56 in afternoon trading Monday. Tesla’sshares fell 1.3 percent to $231.71.

Tesla’s current offer values SolarCity’s shares at $25.37. That’s less than the $26.50 to $28.50 value it placed on them in June, when it made its initial overture to SolarCity. Musk said he had no role in establishing the value of the deal.

“I know about as much as you do about how this price was obtained,” he said.

S&P Global raised its target price for SolarCity shares to $26 but reiterated its “sell” opinion on Tesla shares Monday, saying the deal benefits SolarCity more than Tesla.

“We see benefits from a combined solar/storage offering and manufacturing efficiencies, but remain concerned about cash flow and capital needs,” S&P analyst Efraim Levy said in a research note to investors.

The deal may draw more attention to the financial position of both companies. Tesla has lost $1.2 billion in the past two years alone while SolarCity has suffered losses exceeding $1.1 billion during the same span. Analysts surveyed by FactSet are predicting a $416 million loss from Tesla this year while they believe SolarCity will lose $851 million.

Rebecca Lindland, a senior analyst with Kelley Blue Book, said the deal addresses a tiny market for now. About 1 percent of the 17 million cars sold in the U.S. are electric and only 1.4 percent of single family homes have solar power.

Those markets are expected to grow over time, she said, but in the meantime, both businesses are capital intensive and propped up by government incentives. Electric car buyers can currently get a $7,500 federal tax credit, for example, while solar panel buyers can deduct 30 percent of the cost of their installation from their federal taxes.

“If anything happens with incentives or the economy in general, this could come crashing down even faster than others are projecting,” Lindland said.

SolarCity has a 45-day “go-shop” period in which it can solicit alternative acquisition proposals. It will have to pay Tesla a $78.2 million termination fee unless it ends the deal with Tesla in order to enter an agreement with a third party that initially made an alternative offer before the “go-shop” period ended. If that happens, SolarCity would pay a $26.1 million termination fee, according to a regulatory filing.

Musk said if someone makes a better offer for SolarCity, he has committed to vote his shares with that offer.