BEIJING — American electric automaker Tesla’s plans to produce energy-storage batteries in China moved forward on Friday with a signing ceremony for the land acquisition in Shanghai, China’s state media said.

Construction of the factory is scheduled to start early next year with production to come on line by the end of the year, the official Xinhua News Agency said.

The factory won’t build batteries for cars but for electric utilities and other companies to store power. Such storage units have become increasingly important with the growth in solar and wind energy, which only generate electricity when weather conditions are favorable and need to store it for when residential and commercial users need it.

The new factory will initially produce 10,000 of Tesla’s Megapack units annually for sale worldwide, Xinhua said.

The Tesla project is a rare piece of good news for the Chinese economy, which has seen a sharp drop in foreign investment this year. The Commerce Ministry said this week that foreign investment in the first 11 months of this year was down 10% compared with the same period last year.

Foreign companies are worried about the Chinese government’s increasing control over business on national security and other grounds, as well as growing U.S. restrictions on technology trade with China.

China is a major market and manufacturing center for Tesla, and the company’s CEO, Elon Musk, has built close ties with Chinese officials even as U.S.-China relations soured. In May, he met the commerce minister and the then-foreign minister in Beijing.

Tesla built an electric vehicle plant in Shanghai in 2019 that assembles cars for China, Europe and other overseas markets. China is also by far the world leader in installing wind and solar capacity, making it a major market for energy storage.