Tesla Inc.’s breakthrough deal to secure land for a Shanghai factory commits the electric-car maker to a multi-billion dollar investment just as the Chinese vehicle market falters.

The company secured more than 200 acres of land for its planned Gigafactory 3 in Shanghai with a 973 million yuan ($140 million) bid, according to a statement Wednesday. Acquiring the parcel keeps Tesla on track to spend several billion dollars on its first overseas plant in the world’s largest electric-vehicle market.

But with the first cars from any new factory still years off, Tesla and Chief Executive Officer Elon Musk face a Chinese car market poised to shrink for the first time since at least the 1990s. President Donald Trump’s trade war with China has led to higher Chinese tariffs on American imports, stoking concern about an economic slowdown.

As competition increases from local players, time isn’t on Tesla’s side.

“They need to do things fast,” said Yale Zhang, managing director of Automotive Foresight Shanghai Co. “In China it’s always the fast fish eats the slow fish, not the big fish eats the small fish.”

Tesla fell 1.7 percent to $271.78 in New York trading Wednesday. The stock is down 13 percent this year.

Three-Year Wait

Tesla’s Chinese facility is expected to churn out about 250,000 vehicles annually at first, and that capacity will double over time. But it could be about three years before the first cars roll off the production line, Musk said in August.

Meanwhile, there are signs China’s car market, a mainstay of industry growth, is on the turn. Purchases of passenger vehicles by dealerships plunged for a third straight month in September.

Adding to the worrying outlook in China—Tesla’s largest market after the U.S.—is the economic drag that’s been exacerbated by the trade spat. Factory activity is in retreat and the stock market has slumped, fueling concern over consumer appetite for luxury goods to gambling.

China’s government slapped a new 25 percent tariff on American auto imports in July, adding to an existing 15 percent tariff. Since then, Tesla’s China sales have slowed, falling 30 percent in July and August compared with the same period last year. Tesla sold 1,676 vehicles in China in July and August, the latest month data is available, according to China Automotive Information Net.

‘Headwinds’

“Taking ocean transport costs and import tariffs into account, Tesla is now operating at a 55 percent to 60 percent cost disadvantage compared to the exact same car locally produced in China,” the company said in an Oct. 2 statement that acknowledged what it called “headwinds” from the trade dispute.

This makes for a challenging competitive environment, given that China is by far the largest market for electric vehicles, Tesla said in its statement.

“If the trade war continues unabated, they’re going to be faced with a margin squeeze because of the tariffs,” said Bill Russo, founder and CEO of Shanghai-based consultancy Automobility Ltd. “They are going to have to make the choice: continue to sell at current pricing and eat the tariff penalty, or add to the cost of the car and reduce their market.”

While setting up a factory in China could help avoid those import penalties, local companies like Shanghai-based NIO Inc., which raised $1 billion in a U.S. initial public offering in September, could gain ground. The company is promising more upper-scale cars that aim to close the quality gap with Musk’s EVs, said Steve Man, Bloomberg Intelligence’s Hong Kong-based auto analyst.

Model X Cost

The price of a Tesla Model X 75D would be 611,000 yuan if, like its local competitors, it were exempt from any tariff, according to Bloomberg Intelligence. Following China’s retaliation against Trump’s tariffs by raising costs for American imports, the additional tariffs and value-added taxes have raised the cost of that same Model X to 1 million yuan.

The price of a comparable NIO sport utility vehicle, the ES8, is about 380,000 yuan after subsidies from the central and local governments, according to Bloomberg Intelligence.

“Tesla wants to have this deal with China so they can be in front of this trade war, but I think it’s a little bit too late,” Man said.

To be sure, NIO hasn’t yet established itself in the Chinese market. The company only started delivering vehicles in June and total losses in 2016, 2017 and the first half of 2018 exceeded $1.6 billion, according to Bloomberg New Energy Finance. The company said that it delivered 1,766 of its seven-seat SUV in September, 58 percent more than in August.

Demand for electric vehicles broadly has been strong in China, even though the sector still accounts for a small fraction of the market. Sales of fully electric passenger cars gained 68 percent in the first nine months of 2018, and jumped 84 percent year on year in September alone.

On top of the company’s challenges on China’s mainland, Tesla’s sales in Hong Kong have collapsed following the government’s termination of a generous tax break last year. Tesla sold just 71 vehicles in the city in the first seven months of 2018, down from more than 1,700 in the same period a year earlier, according to Bloomberg Intelligence data.

To stem that decline, Tesla announced on Monday that it was opening a two-level, 50-stall charging facility, the biggest of its kind in the Asia-Pacific region, in the city’s Kowloon Bay district.