Electric car producer Tesla will build its first factory outside the United States in Shanghai, becoming the first wholly foreign-owned automaker in China.
Tesla Inc.'s announcement comes amid mounting U.S.-Chinese tension over technology and follows Beijing's April promise to end restrictions that required foreign automakers to work through local partners.
Tesla said construction would begin in the near future, once official permits are obtained. It said production would begin two to three years after that and eventually increase to 500,000 vehicles annually.
No financial details of the agreement signed Tuesday were announced. A city government statement said the factory would be the biggest foreign investment to date in Shanghai, a base for joint ventures between General Motors Co. and Volkswagen AG and a state-owned automaker.
The signing ceremony was attended by Tesla chairman Elon Musk, Mayor Ying Yong and other Chinese officials, according to the city government.
China is the world's biggest electric vehicle market but Tesla and other producers including GM and Nissan Motor Co. had been reluctant to transfer manufacturing to this country due to the requirement to share technology with Chinese partners that might become rivals.
Tesla began selling cars in China in 2014, shipping them from its California factory, which added a 15 percent import duty to the price. Despite that, China quickly became its No. 2 market after the United States.
"Tesla is deeply committed to the Chinese market," the company said in a statement.
Tesla is among companies hit by additional 25 percent import duties imposed by Beijing in retaliation for a tariff hike by U.S. President Trump in a dispute over technology policy.
"The tariffs may have accelerated their plans for sure, but longer term they need a presence in the largest auto market globally," said Cowen analyst Jeffrey Osborne.
Tesla has discussed opening a factory in China since at least 2016. "Still need to see how it gets paid for, which has been a concern," Osborne added.
Automakers are pouring billions of dollars into developing electric car models for China.
GM, Ford Motor Co., VW, Nissan and other competitors have announced ventures with local automakers to develop models for China's lower-income market.
Sales of pure-electric passenger vehicles in China rose 82 percent last year to 468,000, according to an industry group, the China Association of Automobile Manufacturers. That was more than double the U.S. level of just under 200,000.
Beijing is using access to its market as leverage to induce global automakers to help Chinese brands develop battery and other technology.
Auto brands in China are required to make electric vehicles at least 10 percent of their sales starting next year or buy credits from competitors that exceed their quotas. Later, they face pressure to raise those sales in order to satisfy fuel efficiency requirements that increase annually.
Also Tuesday, Germany's BMW AG announced a partnership with China's biggest SUV maker, Great Wall Motor, to produce electric versions of its MINI cars.
Tesla said it also would set up a research and development facility in Shanghai.
The company said the China factory would not affect production in the United States, which is forecast to increase.
Tesla announced last year it was talking to the Shanghai city government about possibly building a factory.
The plan went ahead after Beijing said in April it would end limits on foreign ownership of electric vehicle producers this year.
Industry analysts said that the ruling Communist Party believes its own producers such as BYD Auto are close to being able to compete with global brands in performance and price.
Ownership restrictions on other parts of the auto industry are to end by 2022, the government said.
The city government statement said local authorities will "strongly support" Tesla as part of efforts to develop Shanghai as a center for electric research and production.
AP Business Writer David Koenig in Dallas contributed to this report.