Tesla already disrupted the auto industry. Now it's changing business in China, too.

For the first time, China will let a foreign automaker open up shop without a Chinese company as its partner.

Tesla has plans to open a plant in Shanghai that will one day crank out 500,000 vehicles a year — enough to rival the company's main plant in Fremont, California.

Tesla said it will be the sole owner of the factory. Until now, China has always required foreign companies to enter joint ventures with domestic companies.

Tesla expects to begin construction in the near future, after it gets the necessary government approvals. From there, the plant will take about two years to build and two to three more years to produce 500,000 vehicles a year.

Related: Tesla hikes prices in China as trade war hits US cars

CEO Elon Musk was in Shanghai on Tuesday for a ceremony with local government authorities.

"Tesla is deeply committed to the Chinese market, and we look forward to building even more cars for our customers here," said a company spokesman. "Today's announcement will not impact our US manufacturing operations, which continue to grow."

China is now the largest market for new car sales, as more Chinese consumers buy them for the first time. The world's automakers have been rushing to build plants there for the last two decades.

Those automakers have always been required to enter joint ventures and share their technology — and their profit — with Chinese partners.

But the Chinese government has been under pressure from the United States and European countries on forced joint ventures and China's alleged theft of intellectual property. That was the justification used by the Trump administration for the tariffs imposed by the United States on $50 billion of Chinese imports.

China has denied it steals trade secrets. But in April, it announced it would start loosening its joint venture requirements for foreign automakers, with the restrictions on electric car manufacturing being removed this year.

The cost of the Tesla plant was not immediately disclosed. The local government said it will be the largest manufacturing project in Shanghai's history funded at least partly by foreign investment.

It was also not immediately clear how independent the new Tesla plant would be.

Related: Tesla finally hits Elon Musk's target for the Model 3

The government said Tesla would wholly own the factory, but it also said the agreement with Tesla would include an "investment agreement" between Tesla and the local authorities.

The government also said Tesla and the city of Shanghai would cooperate on technology and research and development. A Tesla spokesperson said he could not give more details about the investment or agreement on technology cooperation.

Shares of Tesla (TSLA) closed up 1.2% Tuesday.

Tesla long has been interested in expanding production into China, but it wanted to keep control over its manufacturing. It had already disclosed general plans to build a factory in Shanghai, without announcing any details.

"As we try to make cars more and more affordable, it's going to be important to localize production," Musk said at the company's annual meeting in June. He said at that time the company expected to announce details of its plans as soon as this month.

Automakers like to build cars close to where they will sell those cars. Having a plant in China also reduces the risk of being caught in future US-China trade disputes. China has already imposed a 40% tariff on vehicles imported from the United States.

Tesla said Monday it can't absorb that tax and would need to raise the price of Teslas in China as a result. Cars built in China, even by US automakers, are not subject to that tariff.