Electric car company Tesla will build a power facility for Southern California Edison's Mira Loma substation. James Glover/Reuters

Electric car company Tesla has beat several firms in the running for a bid to build a storage facility in California. Tesla’s 20 megawatt-80 megawatt/hour power facility will be located at public utility Southern California Edison’s Mira Loma substation in the city of Ontario. Once built, the energy storage facility will reportedly be the largest operating lithium ion battery storage project in the world.

Tesla will be delivering on the energy storage in a few months instead of years, which is record time for such an endeavor.

"The storage is being procured in a record time frame," Yayoi Sekine, a battery analyst at Bloomberg New Energy Finance, told Bloomberg. "It highlights the maturity of advanced technologies like energy storage to be contracted as a reliable resource in an emergency situation."

The need for a new power storage system stems from the Aliso Canyon gas leak—the largest recorded methane gas leak in U.S. history that released 1.6 million pounds of methane into the atmosphere—which leaves the region vulnerable to electricity shortages. In the aftermath of the leak, where California Gov. Jerry Brown issued a state of emergency, the Aliso Canyon facility was shut down. This May, the California Public Utilities Commission called for energy storage solutions.

"Southern California Edison, among other utilities, was directed to solicit a utility-scale storage solution that could be operational by December 31, 2016," Tesla said in a blog post on Thursday. "Unlike traditional electric generators, batteries can be deployed quickly at scale and do not require any water or gas pipelines."

Manufacturing for the system will take place at Tesla’s under-construction Gigafactory facility in Sparks, Nevada—the factory is being built in installments to simultaneously be in production while under construction and is slated to be complete in 2018. The new system will use the company’s Powerpack industrial energy storage system, which are worth tens of millions of dollars.

“The Gigafactory's ability to produce at a large scale will allow this system to be manufactured, shipped, installed and commissioned in three months,” said Tesla.

The electric car company’s system will work by using electricity from the grid during off-peak hours and deliver that electricity during peak hours to Southern California Edison’s more than 15 million residents. The benefits of this system are two-fold: it will provide a more reliable system and reduce the dependency on natural gas.

“In order to achieve a sustainable energy future, one which has high penetration of solar and electric vehicles, the world needs a two-way, flexible electric grid,” wrote Tesla. “The electric power industry is the last great industry which has not seen the revolutionary effects of storage. Working in close collaboration with Southern California Edison, the Tesla Powerpack system will be a landmark project that truly heralds the new age of storage on the electric grid.”

Tesla CEO Elon Musk has shown interest in transitioning his electric car company into a clean energy company. At the company’s annual shareholder meeting, Musk anticipated half the company’s batteries would go to electricity storage instead of vehicles.

“No one is really doing it right,” said Musk about battery storage. “[Tesla’s] Powerpacks can scale on a global basis faster than the cars do. … I think the rate of growth will be several times that of the car side of Tesla.”