President Donald Trump is attacking Harley-Davidson for planning to shift some of its motorcycle production overseas.

Harley says it stands to lose as much as $100 million a year from new European Union taxes on motorcycles that it would ship from the United States. The EU raised its 6% tariff to 31% last week in response to the Trump administration's tariffs on steel and aluminum imports from Europe.

In a series of tweets Tuesday morning, Trump said Harley is using the European retaliatory tariffs as "an excuse" for moving manufacturing abroad. Trump, echoing a top union for Harley workers, claims the company planned to shift some operations to Thailand before the tariffs were announced.

Harley acknowledged it has already been moving some production abroad, but it says moving more production overseas is its "only sustainable option" in the wake of the growing trade war. The company did not respond to request for comment on Tuesday.

So what's really going on?

Americans are buying fewer motorcycles, people outside the United States are buying more, and Harley wants to build bikes closer to its international customers.

But the tariffs probably hastened Harley's exit.

It makes sense for Harley to reposition its long-term strategy outside the United States: Last quarter, Harley's sales in the United States fell 12%, but they grew 6.8% in Europe, the Middle East, and Africa. In Latin America, sales grew 7%.

Hefty tariffs make selling bikes overseas an expensive proposition for Harley. That's why the company says it needs to open plants abroad to avoid countries' tax and tariff costs and price their motorcycles competitively.

Early this year Harley-Davidson said they would move much of their plant operations in Kansas City to Thailand. That was long before Tariffs were announced. Hence, they were just using Tariffs/Trade War as an excuse. Shows how unbalanced & unfair trade is, but we will fix it..... — Donald J. Trump (@realDonaldTrump) June 26, 2018

For example, the new European tariffs will make each motorcycle about $2,200 more expensive to export, Harley said Monday.

"Increasing international production to alleviate the EU tariff burden is not the company's preference, but represents the only sustainable option to make its motorcycles accessible to customers in the EU and maintain a viable business," the company said in a regulatory filing.

Harley announced in January that it was closing its 20-year-old final assembly plant in Kansas City, Missouri, which employed around 800 workers, and consolidating it into its facility in York, Pennsylvania. It said 450 new jobs would be added to the Pennsylvania location.

Harley said the plant consolidation will save it $65 to $75 million a year beginning in 2020.

In recent years, it opened plants in Brazil, India, and Australia. It's beginning operations at a facility in Thailand later this year.

Related: India spares Harley-Davidson as it hits back at US tariffs

"We see tremendous opportunity particularly in Southeast Asia," CEO Matthew Levatich said in April. "We need to be there and be relevant and grow our share."

Trump's comments Tuesday aligned with union leaders' criticism of Harley. Around a third of Harley's 6,000 workers around are unionized.

"Harley-Davidson's announcement today is the latest slap in the face to the loyal, highly-skilled workforce that made Harley an iconic American brand," said Robert Martinez Jr., president of the International Association of Machinists and Aerospace Workers. "This latest move is in keeping with Harley's past decisions to open plants outside of North America."

Harley faces demographic challenges in the United States. "Their core customer is an older, Caucasian male, and they're exiting the sport," said Joseph Altobello, an analyst who covers the company at Raymond James.

To offset the struggling US market, Harley has shifted its attention to expanding overseas. The company wants its international business to make up half of motorcycle sales, up from 40% last year.

"The brand has a lot of significance internationally," Altobello said. "A lot of people use motorcycles as their primary means of transportation."