Electronics giant Panasonic is injecting $5 billion into Tesla Motors’ plans to erect an enormous lithium-ion battery cell “Gigafactory” somewhere in the U.S.

The companies jointly announced today that they have penned an agreement to collaboratively build the manufacturing plant, which Tesla says will put approximately 6,500 people to work by 2020.

The massive facility, which could reportedly be erected in Arizona, California, New Mexico or Texas, will produce lower-cost battery packs, modules and cells for Tesla’s electric vehicles of the future (perhaps flying cars, too?). The megafactory will also build cheaper batteries for the stationary energy storage market.

Related: Tesla's New Patent Strategy Makes Sense

As far as which company will oversee which duties, Tesla will take on tasks related to scouting, acquiring and managing the “land, buildings and utilities” for its inaugural Gigafactory, which might be the first in a series of them, if things go well. (Elon Musk, Tesla’s eccentric billionaire chairman and CEO, recently posited that the car industry could one day have an appetite for hundreds of battery “Gigafactories.” Two hundred are needed, he said, “just to supply auto demand.")

Tesla, headquartered out of Palo Alto, Calif., is also charged with overseeing operations at the proposed facility, which will be divided into two areas -- one for Tesla's battery pack operations and one for Panasonic’s battery-manufacturing enterprise.

For Panasonic’s part, the Japan-based electronics maker will be responsible for creating cylindrical lithium-ion battery cells, and put up the cash to buy the tools, equipment and machinery needed to make them. Tesla will then assemble the batteries for the battery packs that juice its high-performance (and high-priced) luxury electric cars. Suppliers are already being pooled to feed all of the necessary materials to the planned plant.

Related: Is It Time to Call Tesla the Future of Made In America? Maybe Not.

Panasonic’s big buy-in to Musk’s Gigafactory vision shows that it's serious about further fueling the burgeoning electronic-vehicle market.

"We have already engaged in various collaborative projects with Tesla toward the popularization of electric vehicles, said Yoshihiko Yamada, executive vice president of Panasonic. “Panasonic's lithium-ion battery cells combine the required features for electric vehicles such as high capacity, durability and cost performance. And I believe that once we are able to manufacture lithium-ion battery cells at the Gigafactory, we will be able to accelerate the expansion of the electric vehicle market."

Tesla sees the Gigafactory as a major manufacturing breakthrough, one that will not only produce lower cost batteries, but that also could lead to more affordable electric vehicles.

Related: Elon Musk: 'Maybe We'll Make a Flying Car, Just For Fun'

"The Gigafactory represents a fundamental change," Tesla's chief technical officer says JB Straubel said. "Not only does the Gigafactory enable capacity needed for the Model 3, but it sets the path for a dramatic reduction in the cost of energy storage across a broad range of applications."

Telsa said it will continue to buy and use Panasonic battery cells manufactured in Japan, presumably until the Gigafactory of Musk’s (probably not wildest) dreams is up and running,

The carmaker is expected to report its second-quarter earnings after the market closes today. Its stock recently rebounded following a lag triggered last fall after collision-related fires annihilated a handful of Tesla Model S sedans. Analysts expect Tesla to reveal a modest $3.4 million in profit, down from $26 million at the same time last year, according to International Business Times.

As of 1:14 p.m. ET, Tesla shares were at $226.25, down $2.67 or 1.10 percent.

Related: The Definition of Success, According to 5 Entrepreneur Superstars