The US-China trade war that began this summer is starting to claim collateral victims. Since the Asian country is the world’s largest car market, automakers who build cars in the United States are faced with a 40 percent tariff if they want to sell those vehicles in China – and they are not happy about it.

While most luxury car manufacturers have assembly plants in China, they can’t build all their models there, thus they will be forced to import them from other countries and take the tax hit.

BMW is one of the most exposed automakers to China’s tariffs because the German carmaker builds most of its SUVs in the United States, at the Spartanburg plant in South Carolina.

However, the company seems to have found a way to sidestep tariffs: it will simply build more SUVs at its Thailand facility.

The Bavarian firm announced it is manufacturing between 10,000 and 20,000 X5 sport utility vehicles in Thailand to meet demand from China. BMW started producing the previous-generation X5 in Thailand in the spring of 2016, and the plant there is capable of building a “significant portion” of the vehicles the company would have otherwise exported from the US to China.

In a call to discuss the company’s second-quarter results, CEO Harald Krueger told analysts ramping up production in Thailand was one action to counteract the tariffs.

In related news, BMW today pledged to significantly expand its manufacturing footprint in China, the company’s largest growth market. The BMW Group and Brilliance Automotive Group have agreed to further expand their BMW Brilliance Automotive (BBA) joint venture, which will export the all-electric iX3 SUV to markets outside of China.

In addition to the expansion of the BBA joint venture, the BMW Group has signed an agreement with Great Wall Motor to build electric MINI vehicles in China through a 50:50 joint venture. The new company will also build EVs for GWM.