On Sunday morning the Wall Street Journal reported that Tesla has reached an agreement to open a factory in Shanghai.

The electric vehicle (EV) company has had grand ambitions for increasing its market share in China, and in June of this year Tesla said it was in talks with the Shanghai government about opening a manufacturing facility. At the time, the company said it hoped to reach a deal by year’s end.

Ars reached out to Tesla, and spokesperson Kady Cooper said the company wouldn’t make new comments on the WSJ article, but referred Ars to a statement Tesla made in June, which noted:

Tesla is working with the Shanghai Municipal Government to explore the possibility of establishing a manufacturing facility in the region to serve the Chinese market. As we’ve said before, we expect to more clearly define our plans for production in China by the end of the year. Tesla is deeply committed to the Chinese market, and we continue to evaluate potential manufacturing sites around the globe to serve the local markets. While we expect most of our production to remain in the US, we do need to establish local factories to ensure affordability for the markets they serve.”

The WSJ report specified that any future factory would be set up in Shanghai’s “free trade zone,” and Tesla vehicles would still be subject to an import tariff of 25 percent. But having a nearby factory could help the company reduce transportation costs and give the company more immediate access to the Chinese supply chain. It could also help curry favor with the Chinese government, which has indicated that it might impose aggressive policies to favor electric vehicles over internal combustion cars in the future.

China already has the most electric passenger vehicles in the world. In 2016, more than 40 percent of all the EVs sold globally were sold in China, and as Ars wrote in June, “the country also has 200 million electric two-wheelers, 3 million to 4 million low-speed electric vehicles, and more than 300,000 electric buses.”

Some foreign auto manufacturers already build their cars in China, but to avoid the 25 percent tariffs China requires the car makers to find a local partner to build those vehicles, which can mean splitting profits, losing control over the finished product, and sharing trade secrets with a local company. In the country’s free trade zones, however, Tesla would be able to build a “wholly owned factory,” according to the WSJ.

“Tesla is currently working with the Shanghai government about details of the deal’s announcement, such as timing,” the WSJ added.

Solving manufacturing issues has become a critical component of Tesla's business in recent years. The company's recently-launched Model 3 had a disappointing initial quarter due to inability to meet demand, which Tesla blamed on "manufacturing subsystems" taking "longer to activate" than expected. Tesla's CEO Elon Musk has set ambitious goals for the company, saying he expects to eventually ramp up to delivering 500,000 Model 3s every year. China will no doubt be a part of meeting that lofty goal.