Tesla Motors CEO Elon Musk recently said that Tesla was open-sourcing its patents because it realized that its patent rigidity was only harming, not helping, the electric car market. Musk’s company has now moved one-step closer to moving electric vehicles into what will become the vehicle of the future.

Tesla Motors and Panasonic signed a deal on Friday to open up a US factory in which Panasonic will make battery cells for Tesla’s electric vehicles. The US factory will be called the Gigafactory, as Tesla looks to produce up to 50 Gigawatt-hours of battery packs by the year 2020, according to the Tesla press release.

According to the Tesla-Panasonic agreement, the Gigafactory lands, buildings, and utilities will all be maintained by Tesla while Panasonic provides the lithium-ion batteries as well as investment for the various machinery and equipment that’ll be used to create the lithium-ion batteries. Until such batteries can be mass-produced at the Gigafactory, Tesla promises to continue investing in Panasonic’s batteries from its Japanese factory. The purpose of the Gigafactory is to bring battery production to the United States in an effort to keep costs low – making electric vehicles more attractive to consumers and more affordable. Affordability is one key way to take a product from “niche” to “mass.”

The Gigafactory deal will bring 6,500 new jobs to the United States, and both Tesla and Panasonic are considering states such as Arizona, Texas, Nevada, New Mexico, and California for the Gigafactory – though no state has been chosen as of this time. The Gigafactory will span anywhere from 500-1,000 acres in size.

Panasonic Executive VP Yoshihiko Yamada praised this move and said that it’s necessary to make electric vehicles the transportation of the future: “We have already engaged in various collaborative projects with Tesla toward the popularization of electric vehicles. 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.”

The new Gigafactory is expected to cost $4-$5 billion, with Tesla investing $2 billion and Tesla investors pouring in an additional $2-$3 billion.