Tesla has signed a deal with electronics maker Panasonic to build a massive battery production plant in the US. The Gigafactory, as it's being dubbed, will be a crucial step in the production of Tesla's upcoming Model 3 which is slated to arrive sometime in 2017.

As per the agreement, Tesla will prepare, provide and manage the land, buildings and utilities for the Gigafactory. Panasonic, meanwhile, will manufacture and supply cylindrical lithium-ion cells and invest in the associated equipment, machinery and other manufacturing tools based on their mutual approval.

A network of suppliers will be in place to ensure the facility has access to production materials at all times.

The facility, which will require an investment of up to $5 billion, is expected to create some 6,500 new jobs. It'll produce 35GWh of cells and 50GWh of packs per year by 2020 but in the interim, Tesla will continue to purchase batteries from Panasonic's factories in Japan for current and existing vehicles like the Model X.

Naturally, a number of states are vying for the bid with finalists including Arizona, California, Nevada, New Mexico and Texas. No word yet on when Tesla will decide where to build the Gigafactory.

The upcoming Model 3 is likely to be the vehicle that puts Tesla on the map. At $35,000, it'll be the first electric vehicle from Tesla that'll be affordable to the masses. The current Model S sells for around $70,000 or more.