A burgeoning trade war has already affected Tesla’s business in the world’s largest electric vehicle market, China.

President Donald Trump imposed tariffs on $34 billion worth of Chinese goods Friday, and China retaliated in kind. Trump has threatened a 20 percent tariff on imported cars; China went ahead and included automobiles in its list, raising the tariff for American-made vehicles to 40 percent.

That creates a new headache for Elon Musk, who has been trying for years to expand Tesla’s foothold in China’s EV market. That country is already Tesla’s second-largest market, receiving approximately 17,000 Teslas last year, according to the China Automobile Dealers Association.

Tesla responded to the tariffs by raising prices for the Model S and Model X in China on the order of $20,000 to $30,000, depending on the model. Bloomberg has a visualization of the price increases here.

The cars already fetch a price above $100,000 in that market. Souped-up P100D models enter into $200,000 territory. Demand at that luxury level may prove inelastic; it’s not immediately clear how many customers will be deterred by an 11 percent surcharge on an already expensive foreign car.

Tariffs pose more of a threat for future Model 3 sales, which would be accessible to a much wider range of customers.

With no end in sight for trade hostilities, tariffs may hasten Tesla’s existing plans to build a combined battery production and vehicle assembly Gigafactory in Shanghai. An announcement on that could come this month, Musk said at a shareholder meeting in June.

Musk plans to meet with Chinese government officials in Shanghai this week, in addition to visiting Beijing, Bloomberg reported. The article did not identify the official purpose of the meeting.

Establishing a manufacturing base in China would allow Tesla to evade import duties and deliver vehicles more quickly to the country's customer base. 

The roiling trade war adds an external challenge for Tesla, which has been grappling with several internal problems in recent months.

After publicly committing last year to build 5,000 Model 3 units a week by the end of 2017 and 10,000 a week at some point in 2018, the company fell far behind. It only crossed the 5,000-per-week threshold this July.

In June, the company laid off 9 percent of its workers, targeting jobs that “are not vital to the success of our mission.” The cuts didn’t touch Model 3 production, but hit hard on the company’s solar energy division, the remnants of former rooftop market leader SolarCity.

The company will shut down 13 or 14 solar installation facilities across California, Maryland, New Jersey, Texas, New York, New Hampshire, Connecticut, Arizona and Delaware, Reuters reported. When Musk pushed for the $2.6 billion acquisition of SolarCity in 2016, he framed it as a union of leaders in the clean energy space. Delays at the core automobile business coupled with reforms to Tesla's solar arm have cast a shadow on that ambitious vision.