A day after it announced price hikes for the Model S and Model X in China, in response to new tariffs on imported electric cars in the country, Tesla has finalized a deal to build a new factory in Shanghai, according to a Bloomberg News report.

Tesla CEO Elon Musk was in Shanghai Tuesday to appear in a joint announcement with the city government.

Tesla CEO Elon Musk (r.) and Shanghai Mayor Ying Yong in Shanghai July 10, 2018

Tesla CEO Elon Musk (r.) and Shanghai Mayor Ying Yong in Shanghai July 10, 2018

"Last year, we announced that we were working with the Shanghai Municipal Government to explore the possibility of establishing a factory in the region to serve the Chinese market," a Tesla spokeswoman said in an statement emailed to Green Car Reports. "Today, we have signed a Cooperative Agreement for Tesla to start building Gigafactory 3, a new electric vehicle manufacturing facility in Shanghai."

"We expect construction to begin in the near future, after we get all the necessary approvals and permits. From there, it will take roughly two years until we start producing vehicles and then another two to three years before the factory is fully ramped up to produce around 500,000 vehicles per year for Chinese customers."

"Today’s announcement will not impact our U.S. manufacturing operations, which continue to grow.”

CHECK OUT: Tesla hikes prices in China in first response to trade war

The new deal lays out plans to build a factory as big as the company's primary factory in Fremont, California, which produced just over 53,000 cars last quarter. Musk plans for the Fremont factory to produce 450,000 cars or more at full capacity.

Once the new China factory is operational, Tesla could build cars for the Chinese market without paying the new import duties.

The Shanghai factory could also give the company room to build additional models.

Tesla factory, Fremont, California

Tesla factory, Fremont, California

Tesla analysts have noted that the Fremont factory has no room to add an additional assembly line to build the planned Model Y SUV, which Musk has said is due in late 2019 or early 2020. 

When it added a second assembly line to produce more Model 3s, the company constructed a giant tent running out from the Fremont factory to produce more cars. 

READ THIS: Tesla Model 3 production reaches 5,000 cars in last week of June

Tesla is the second American manufacturer with plans to expand overseas, following Harley-Davidson, since a round of retaliatory tariffs broke out under President Trump.

Musk has also said the company will reveal plans near the end of 2018 to build a factory in Europe.