NEW YORK -- Tesla is required to contribute roughly $323 million in annual Chinese taxes starting at the end of 2023 as part of the company's lease agreement with the Shanghai municipal government.

The company is also committed to invest approximately $2.04 billion (14.08 billion yuan) into Gigafactory Shanghai, its first Chinese manufacturing plant, in the next five years, according to Tesla's SEC fillings submitted Monday.

If billionaire Elon Musk's electric carmaker is unable, or unwilling, to meet the terms, Tesla will have to return the factory site to the local government and receive compensation for the remaining value of the land lease, the filings show.

Tesla broke ground on the so-called Gigafactory Shanghai earlier this year hoping to gain ground in the world's biggest electric vehicle market and avoid tariffs due to the U.S.-China trade war. The company raised retail prices in China last year because of China's retaliatory tariffs placed on U.S. vehicles, which caused Chinese sales to plunge 70% in October.

Tesla expects production at its Gigafactory Shanghai to help the company offer competitive local pricing of the Model 3 in China, according to the fillings. The Chinese-made Model 3s will be priced at $47,700 and is only available through pre-order at the moment, according to Tesla China's website.

Earlier this month, Tesla cut prices of Model 3 sedans worldwide, including in China. The best-selling car's price dropped 5.6% to $51,770, which is still higher than its $38,990 starting price in the U.S.

The company also expects to start production by the end of this year. The first phase trial run will produce 150,000 Model 3 cars each year, but the time-frame for the Gigafactory Shanghai is subject to "uncertainties," such as regulatory approval and supply chain constraints, according to the fillings.

The news of the high tax bill comes after Tesla delivered a disappointing earnings call last week. Although the company's sales soared 60% on the year in the April-June quarter, profits fell far below Tesla's forecast due to surging sales of the Model 3 compared with higher-end models. Tesla hoped the Model 3 would help with growth, but has struggled to turn a profit because of the car's low price.

On the up side, Tesla's quarterly shipments grew 130% from the same period last year to 95,356 units. More than 80% were Model 3s. The company's earnings could increase when its Gigafactory Shanghai goes online.

As the company prepares for trial production, Tesla also said in the fillings that it expects much of the investment in Gigafactory Shanghai to be funded through local banks and financial institutions in China, including an agreement signed in March with Chinese lenders for a 12-month credit facility of up to $521 million for the Gigafactory.