It was as far back as 2012 that we first heard BMW was considering building cars in Mexico, and on Thursday the automaker opened a new plant south of the border that initially is building 3-Series sedans, both for local sale and export worldwide.

The plant is located in the state of San Luis Potosi and already employs 2,500 staff. The maximum capacity is 175,000 vehicles per year, some of which are earmarked for the United States.

Unfortunately for BMW and other automakers building cars in Mexico, President Donald Trump's threats of tariffs on Mexican products entering the U.S., which will start at 5 percent and rise to 25 percent by October if Mexico fails to stop undocumented immigrants crossing its border into the U.S., could throw a major spanner into the works.

BMW had looked at adding a second plant in the U.S. but chose Mexico to create added flexibility to its worldwide production network which now spans 31 locations.

BMW plant in San Luis Potosi, Mexico

BMW plant in San Luis Potosi, Mexico

The automaker isn't completely ignoring the U.S., since it plans to invest $600 million in its plant in Spartanburg, South Carolina, over the next two years to to gear it up for future SUV models, starting with a redesigned X6 range. This will see the number of jobs at the site increase to 11,000. The site is BMW's single biggest plant.

Considering that most of the cars built at the Mexican plant will be exported to markets other than the U.S., BMW has the flexibility to continue importing the 3-Series from the current location in Germany if faced with steep tariffs on its Mexican-built cars. BMW 3-Series sales in the U.S. have averaged about 74,000 units annually over the past five years.

“We will keep our plans and we will see how far that goes,” Oliver Zipse, BMW's head of production, told CNBC in an interview Thursday when asked if the automaker will shift production if the tariffs are implemented. “Our production network is flexible, but at this point I don’t see any reason to change our plans.”

Prior to the Trump administration, Mexico had been seen as an ideal location for a number of automakers due to the country’s lower wages and free trade agreements with the U.S. and Canada, as well as some Asian and South American countries. Not surprisingly, a number of BMW’s rivals have also opened plants in Mexico. Audi builds its Q5 there and Mercedes-Benz is building the new A-Class sedan and plans to add more compact cars at its Mexican plant.

2019 BMW 3-Series (330i M Sport)

2019 BMW 3-Series (330i M Sport)