Tesla announced Wednesday it has officially signed a land deal with the Shanghai government to build its Chinese Gigafactory.

The plant will focus on electric-vehicle production for China’s rapidly growing market. After construction begins, the carmaker set a two-year timeline for beginning to roll vehicles off the line. Once fully ramped two to three years after opening, the plant is slated to produce about 500,000 vehicles per year.

In a statement on the deal, Tesla said the announcement “follows a record quarter for Tesla vehicle production and deliveries.” According to its Q3 numbers, Tesla delivered 83,500 vehicles and produced 80,142. It also nearly doubled its Model 3 deliveries from 28,578 in Q2 to 55,840 in Q3.

Tesla said the city of Shanghai will provide support for the next Gigafactory. In July the city said it “will strongly support” the company in promoting innovation and development. Tesla declined to comment further or clarify what that support will entail.

In announcing the Chinese factory, Musk reportedly said all future Gigafactories would include manufacturing capacity for Tesla vehicles.

The deal also comes amid questions about Tesla’s existing Gigafactory operations in New York and Nevada (and the emotional well-being of its CEO), which have reportedly struggled to meet the ambitious production goals set out by Musk.

Tesla received tax breaks in Nevada and New York. Though a recent audit conducted by Nevada officials showed Tesla met its investment benchmark in the state, skeptics have questioned whether the company can deliver on the thousands of jobs and economic benefits it promised in both locations.

The situation at Tesla’s Buffalo, New York facility remains less clear. An August report from Reuters suggested Tesla’s vision for solar roof tiles is floundering, and the company appears to be putting less emphasis on its solar division.

Recent reports indicate that Panasonic, Tesla’s partner in both U.S. Gigafactories, could begin selling the cell and modules produced in New York to other customers. The company told Greentech Media that the agreement always allowed for Panasonic to sell to other companies.

Panasonic also told GTM in September that production at the Buffalo Gigafactory remained “on track” but declined to provide specific production numbers.

When Tesla’s China factory comes online, it should help the company expand market share in an increasingly integral market. This summer, The Wall Street Journal reported that China is now home to 487 electric-car makers. The country accounted for nearly half of EVs sold last year.

Currently, Tesla must pay a 40 percent import tariff for vehicles sold to Chinese customers. Though there’s no end to the U.S.-China trade war in sight, the Shanghai facility could ramp just as President Trump’s current term comes to an end.

Last year, Musk said on a Tesla earnings call that building a factory in China is “really the only way to make cars affordable” there.