STUTTGART, Germany — For as long as Donald Trump has been president, he has been threatening to slap tariffs on foreign carmakers to stop flashy German vehicles from “flooding” American streets.

On Friday, he repeated the threat and attached a specific number, tweeting about a 20 percent tariff on all automobile imports from the European Union.

Here in Stuttgart, the heartland of the German automotive industry since a couple of 19th-century engineers put the horse-drawn carriage out to pasture, a realization is setting in: He just might do it.

“Eighteen months ago, I would never have believed it,” said Uwe Meinhardt, a union official who represents autoworkers in a city where nearly one in five employees has a job in the industry.

Now that Trump has made good on other once-seemingly far-fetched threats against European allies, Meinhardt is trying to get used to the idea that his workers may be the U.S. president’s “next victims.”

Trump has dramatically raised trade tensions on multiple fronts, with tariffs on a range of Chinese goods announced last week and the future of NAFTA left dangling by Trump’s insistence on renegotiating the 1990s-era treaty with Canada and Mexico. The International Monetary Fund recently warned that the U.S. moves were putting the global trading system at risk.

In Europe, car tariffs are shaping up as the next battle in what officials here fear is developing into a full-blown trade war between the United States and its closest allies. Trump has imposed tariffs on steel and aluminum imported from the E.U., and the E.U. on Friday imposed countertariffs on U.S. goods including whisky and motorcycles. 

Germany Foreign Minister Heiko Maas criticized U.S. threats of new tariffs on the auto industry May 29, saying, "German cars make American roads more secure." (Reuters)

Although auto tariffs would be aimed broadly at imports, with vehicles from major manufacturing hubs such as Mexico, Canada and Japan all likely to be affected, Trump has singled out German vehicles as a particular object of his ire. 

And studies show that Germany stands to suffer more in absolute terms than any other nation exporting vehicles to the United States, with losses in the billions of dollars and a meaningful bite taken out of the nation’s gross domestic product. German auto giant Daimler warned Thursday that the tensions would hurt profits. It was the first carmaker to make such an announcement.

The president has long railed against high-end BMWs, Mercedes-Benzes and other luxury imports, using newspaper interviews, campaign appearances and tweets to rip what he has described as an unfair tariff structure that makes German brands prevalent on U.S. roads while American vehicles remain relatively scarce in Europe.

“When you walk down Fifth Avenue, everybody has a Mercedes-Benz parked in front of his house,” Trump told the German tabloid Bild just before his inauguration. “How many Chevrolets do you see in Germany? Not many, maybe none. . . . It’s a one-way street.”

On Friday, Trump suggested that auto tariffs would come in response to European trade practices. He tweeted: “Based on the Tariffs and Trade Barriers long placed on the U.S. and it great companies and workers by the European Union, if these Tariffs and Barriers are not soon broken down and removed, we will be placing a 20% Tariff on all of their cars coming into the U.S. Build them here!”

Last month, he asked the Commerce Department to investigate whether automotive imports constitute a threat to U.S. national security — a notion that draws scorn from economists but could be employed as an alternative pretext for tariffs.

Trump also cited national security to justify the steel and aluminum tariffs. Although Europe, Canada and Mexico were initially exempt, the administration decided at the end of May that close allies would get the same treatment as adversaries such as China.

Days later, a Group of Seven summit collapsed in spectacular fashion, with Trump taking to Twitter as he jetted out of town to complain that international partners were taking advantage of the United States on trade, and to remind them he was considering “Tariffs on automobiles flooding the U.S. Market!

Trump’s words and deeds have fed a growing conviction in Germany that the vehicle tariffs, if not inevitable, are certainly possible, and that the country needs to be prepared.

In an interview with the public broadcaster ARD, Chancellor Angela Merkel acknowledged that the tariffs may be coming and promised that Europe would respond in kind. “One can’t take advantage of us again and again,” Merkel warned.

The tough talk is of little comfort here in Stuttgart, where the prospect of a trade war with the area’s most important economic partner fills residents with dread.

“Every second euro in this region is earned abroad,” said Tassilo Zywietz, a director at Stuttgart’s chamber of commerce who focuses on the region’s heavily export-driven economy. “Targeting the automotive industry would be a stab in our heart.”

Stuttgart, a hilly city laced with vineyards in Germany’s prosperous southwest, lays justifiable claim to being “the cradle of the automobile.” It was here in 1886 that Gottlieb Daimler pioneered the four-wheeled “motor carriage.” Working just up the road, Karl Benz was on to something similar.

The corporate heir to their discoveries — manufacturer of the Mercedes-Benz — is still based here, as is Porsche. The region is packed with assembly plants, parts makers and engineering firms — all supporting an industry that is considered a pride of the nation.

Yet, despite healthy profits, all is not well for the automakers. The Volkswagen diesel-emissions scandal tarnished the reputation of the entire industry, and German carmakers have been considered slow to shift to hybrid or electric vehicles. Now, their business with two of their most important markets could be disrupted — Britain because of Brexit and the United States because of tariffs.

“We are watching the U.S. debate very closely,” Porsche said in an emailed statement. “A third of our sales are in North America and since we don’t have production sites there, we have to take the situation seriously.”

Other German manufacturers — including BMW, Volkswagen and Mercedes owner Daimler — have significantly boosted production capabilities in the United States over the past decade and are considered somewhat less vulnerable to tariffs.

German companies’ American plants and subcontractors employed more than 110,000 workers and had an output of more than 800,000 vehicles last year, according to the German Automotive Industry Association. That compares with about 500,000 cars exported from Germany to the United States.

The tariffs would knock about $6 billion, or nearly 0.2 percent of GDP, out of the German economy through lost sales and profits on cars imported directly from Germany, according to a study by the Munich-based Ifo Center for International Economics.

“Tariffs will cost the German automakers market share. That’s very clear,” said Gabriel Felbermayr, the center’s director.

The automakers’ exposure does not end there. About 500,000 cars were exported to the United States from German plants in other countries, such as Mexico, meaning a breakdown of NAFTA could compound the damage.

German manufacturers also export cars made in the United States — BMW boasts that it is the largest U.S. auto exporter by value — so they could be caught in the crossfire if the United States and China escalate their spat.

The United States, too, stands to lose as trade barriers grow, Felbermayr noted. 

“A trade war is not easy to win,” he said. “Either side will be paying higher costs.”

That is the message German officials have been trying to send, to little avail. Nicole Hoffmeister-Kraut, the economy minister in the state of Baden-Württemberg, where Stuttgart is the capital, said the area’s prosperity should be an advertisement for the virtues of free trade.

The region may send many goods to the United States, but it is also a major purchaser of U.S. services, particularly in technology. Hoffmeister-Kraut said the United States and the E.U. should be negotiating lower trade barriers, not unilaterally raising them — a point other German officials and the automakers themselves have echoed.

“The trade is actually quite balanced,” she said. “Protectionism is not the right way forward.”

Yet some here say they can see Trump’s point of view, even if they do not care for his combative style.

Gokhan Balkis, chief executive of a car parts supplier based in the nearby Black Forest region, said he shares Trump’s concern about the disparity in car tariffs: The European Union charges 10 percent on U.S. imports, compared with the 2.5 percent the United States charges on E.U. imports.

“I don’t like how he’s doing it,” Balkis said. “But it’s correct to talk about it.”

Balkis said he would like to see both sides reduce, and perhaps eliminate, their barriers.

Other executives supplying the auto industry said they, too, would not mind that. But they cautioned that a more equitable set of tariffs will not necessarily mean more American cars on European roads — or fewer European cars on American roads.

Mixed in with the concern is also a supreme confidence in the superiority of German engineering.

“People will still buy German cars,” said Andreas Kramski, chief executive of a family business that makes billions of parts annually for auto manufacturers worldwide. “It wouldn’t be very patriotic for an American to say, but it’s a matter of fact: German cars are just better.”

Luisa Beck in Berlin contributed to this report.