Tesla Inc. will build a new battery factory in Shanghai, increasing investment in China at a time of brewing tensions between Beijing and Washington.

Tesla will manufacture Megapack large-scale energy-storage units in the new facility, which adds to its factory for electric vehicles in Shanghai. Tesla made the announcement at a signing ceremony for the project in Shanghai. Tom Zhu, Tesla’s senior vice president of automotive, and Shanghai government officials including vice mayor Wu Qing attended, with Tesla Vice President Tao Lin signing the contract.

Tesla CEO Elon Musk was also reportedly in China at the time.

Tesla is leveraging China’s world leading battery supply chain to ramp up output and lower costs of Megapack lithium ion battery units to meet rising demand of energy storage globally as the world shifts to use more renewable energy.

Construction is scheduled to begin in the third quarter of this year and the plant will commence production in the second quarter of 2024, the company said in a statement.

Tesla already operates a Megafactory in Lathrop, Calif., capable of manufacturing 10,000 Megapacks per year.

Tesla’s deepening China investment comes shortly after France’s Airbus SE announced plans to double its production capacity in the country for one of its top-selling jets. The European planemaker will add a second final assembly line for A320 narrow-bodies at a factory in Tianjin, under a deal signed by CEO Guillaume Faury in Beijing on Thursday.

The new manufacturing projects give a boost for Chinese industry as other firms like Apple Inc. rethink production in the nation amid heightened tensions with the U.S. over everything from an alleged Chinese spy balloon being shot down over American skies to Beijing’s partnership with Russian President Vladimir Putin.

The Megapack is intended as a massive battery to help stabilize energy grids, with the company saying each unit can store enough energy to power an average of 3,600 homes for one hour. The new factory will initially produce 10,000 Megapacks every year, equal to around 40 GWh of energy storage, and the products will be sold worldwide.

China, home to rising global electric vehicle maker BYD Co., is an extremely important market for Tesla. Its existing car factory on the outskirts of Shanghai, which the U.S. company owns outright, produced almost 711,000 EVs last year, or 52 percent of its worldwide output — even with production being disrupted by China’s now-abandoned COVID Zero policy.

Authorities rolled out the red carpet to help Tesla set up its first plant outside the U.S. in early 2019, and Shanghai government officials assisted the company with resuming production in a timely manner after pandemic-related disruptions.

Musk’s time operating in China hasn’t been entirely smooth, however. An expansion of the Shanghai EV plant was delayed over data concerns about Tesla’s connections to Musk’s internet-from-space initiative Starlink, people familiar with the matter said earlier this year, days after angry Tesla owners swarmed showrooms in China to complain about missing out on another round of price cuts.

Tesla cars also were banned from Chinese military complexes and housing compounds in early 2021 over concerns about sensitive data being collected by cameras built into the vehicles.

Musk said on an earnings call in January that China is the most competitive auto market. He’s made similar comments before, including during an online forum in September 2021, when he said he had “a great deal of respect for the many Chinese automakers.”