BMW workers in San Luis Potosí Mexico working on 3 series cars. Meghan Reeder | CNBC

Timing is everything, and right now, BMW's expansion into Mexico is coming at a terrible time. The German automaker's newest final assembly plant officially opened Thursday in San Luis Potosi, Mexico, four days before President Donald Trump's threatened 5% tariff on all Mexican products is scheduled to take effect. That could add hundreds of dollars to the cost of the 3 Series sedans BMW is shipping across the border to the U.S., but it isn't deterring the company. "We will keep our plans and we will see how far that goes," said Oliver Zipse, a member of BMW's board of management, when asked whether the automaker will shift production plans in the event of the tariff. "Our production network is flexible, but at this point I don't see any reason to change our plans." Zipse says the automaker has not decided how it would handle the added cost per vehicle. BMW's decision to eat the cost of a tariff or pass some, if not all, of it along to the American buyer will depend on how other automakers are pricing models that compete with the 3 Series, like the Mercedes-Benz C class.

BMW Series 3 cars produced in San Luis Potosí Mexico and being loaded onto a truck for export. Meghan Reeder | CNBC

When the automaker broke ground on the $1 billion plant in 2016, it was seen by analysts and investors as a smart move. After all, the plant would ship new 3 Series sedans to markets around the world, most notably, the United States. In early 2016, there was little chatter of completely dismantling the North American Free Trade Agreement and ending the sizable cost advantage automakers gain from building in Mexico, where labor costs are lower. Many people dismissed threats from then-presidential candidate Trump to end NAFTA if elected president. Three years later, Trump is in the White House and NAFTA is virtually dead due to the new United States-Mexico-Canada Agreement, which still needs to be ratified by all three countries. Even more troubling for BMW and other automakers with plants in Mexico, Trump wants to slap a 5% tariff on everything imported from south of the border to pressure Mexican President Andres Manuel Lopez Obrador into controlling illegal immigration into the U.S. "The timing of new tariffs and related uncertainty could not come at a worse moment for the auto industry," LMC Automotive wrote in a research note. LMC estimates the average price of a vehicle imported from Mexico would jump by $1,700 if a 5% tariff is tacked on at the border. If the tariff climbs to 25% in October, as Trump has threatened, LMC estimates the average price of Mexican-made vehicle would jump by $8,500.

BMW workers in San Luis Potosí, Mexico working on 3 series. Meghan Reeder | CNBC

For automakers, the rapidly changing trade barriers is causing them to rethink major production decisions made years ago when few people expected tariffs to be imposed or threatened with such force. For example, GM made plans to import the Buick Envision from China, thinking the tariff of 2.5% was manageable. Today, that vehicle is taxed at 25%. Not surprisingly, GM said it's importing and selling far fewer Envisions than it originally hoped. "Largely these decisions predate Donald Trump," said Kristin Dziczek of the Center for Automotive Research. "The capital allocation for a new plant will cost $1 billion to $1.5 billion. It may take three to four years from the time a decision is made to when a vehicle is rolling off the assembly line." BMW's assembly lines in San Luis Potosi are just ramping up production. The plant started building 3 Series sedans in April and expects to make roughly 20,000 this year. Not all are being shipped to the U.S. In fact, shipments to other countries is expected to far outpace the number sent to the U.S. What happens if Trump follows through on his threat to slap a 5% tax on everything coming from Mexico? BMW could continue shipping 3 Series to the U.S. from Germany, as it has done for years. That may not work over the long term, however, if he follows through on another trade threat he's made several times, raising the tariff on vehicles built in Europe and shipped to the U.S. When asked if BMW would lobby Trump to change his Mexico tariff plan, Zipse said, "We lobby with facts. The fact is we are investing $600 million in the U.S. in 2019, 2020 and 2021."

BMW Series 3 cars made in Mexico ready for export. Meghan Reeder | CNBC