Tesla shifted into a higher gear in China in August, nearly tripling output at its Shanghai factory after a slowdown for upgrades and delivering more cars to Chinese buyers than its three largest home-grown competitors combined.

The American company's massive Shanghai facility produced 76,965 vehicles in August, 173 percent more than a month earlier and just under its highest ever monthly total of 78,906 in June.

The facility in Shanghai's Lingang free-trade zone, officially called Gigafactory 3, delivered 34,502 Model 3 and Model Y vehicles to mainland customers last month, according to data from the China Passenger Car Association (CPCA). That is more than quadruple July's total of 8,461 while factory upgrades were in progress.

Tesla sold 40 percent more cars in August in China than its top three Chinese rivals put together, as Nio, Xpeng and Li Auto combined to sell 24,766 vehicles.

Tesla also exported 42,463 cars to overseas markets in August.

"Tesla is clawing back lost ground," said Tian Maowei, a sales manager at Yiyou Auto Service in Shanghai. "After it expanded its capacity, the Shanghai plant is powering ahead with production in August, nearing its record."

The Shanghai factory, also known as Giga Shanghai, has an annual production capacity of about 1 million units after the upgrades, which were carried out in July and early August to boost capacity by about 30 percent.

The additional capacity should help the US carmaker make up for ground it lost when a two-month citywide Covid-19 lockdown forced the Shanghai factory to halt production between March 28 and April 18, slashing production volume by 70,000 cars.

Tesla chief executive Elon Musk wrote in a post on the Weibo microblog site on August 18 that more of the company's newly built cars would be exported than delivered to domestic buyers during the first half of the current quarter, with the distribution shifting towards local customers in the second half.

Tesla recently lost its crown as the world's largest electric vehicle producer by sales to Chinese giant BYD.

BYD, backed by Warren Buffett's Berkshire Hathaway, sold about 641,000 new energy vehicles, a category that includes pure electric and plug-in hybrid cars, in the first half of this year, beating Tesla's 564,000 units delivered in the same period.