Tesla Motors CEO Elon Musk said Wednesday that the world will need to build several lithium-ion battery factories to meet a "quasi-infinite demand for energy storage."

Speaking at the World Energy Innovation Forum, Musk said Tesla Motors alone needs its planned $5 billion lithium battery factory to continue the company's rapid growth. Without the proposed "gigafactory" the electric-car maker would lack the batteries it needs to ramp up car production and introduce new models, he said.

"We're building the gigafactory because we can't think of any other way to scale," Musk told the energy forum at the company's factory in Fremont. "We either hit the sides of the Petri dish, or we build a bigger Petri dish."

The forum, which focused on market-transforming ideas in energy, took place in a corner of the sprawling auto plant where Tesla makes its second car model, the Model S.

The proposed gigafactory would double worldwide production of lithium-ion batteries, which could help lower battery production costs 30 percent just in its first year of full-scale operation. Tesla hopes to use those savings to create its $35,000 Gen 3 car, the company's first car aimed at the middle class.