Donald Trump has been spoiling for a fight over what he sees as unfair trade for a long time — and a strong U.S. economy may give him leeway to carry on the battle longer than other countries.

The many critics of the president’s trade strategy figured he would back down before tariffs and other U.S. sanctions caused much damage, especially ahead of critical U.S. elections in the fall. What they weren’t counting on was the best economy in years giving a stubborn president more elbow room.

The U.S. economy is on track to grow at a 3.7% annual clip in the second quarter, putting it on pace to potentially top 3% growth this year for the first time since 2005.

Read:The U.S. economy might hit this milestone for the first time in 11 years if corporate America keeps it up

The Trump tax cuts, higher government spending, an ultralow unemployment rate and the biggest increase in business investment in several years are propelling the economy forward.

“The economy is doing well. You don’t want to see it happen, but there are a lot of worse times [a trade fight] could happen,” said Gus Faucher, chief economist at PNC Financial Services in Pittsburgh.

By contrast, the Canadian economy is growing at its weakest rate in two years, and Europe has suffered a surprising slowdown. Both could post sub-2% growth in 2018. China, for its part, is enduring a bear market in stocks tied in part to anxiety over trade.

The U.S. economy is more shielded because so much of what takes place involves Americans selling and buying from other Americans. Exports represent about 12% of the American economy vs. nearly 20% for China, one-third for Canada and almost 50% for Germany.

“Nobody wins in a trade war, but the U.S. is much, much less dependent on exports as a percentage of our economy,” said Carl Tannenbaum, chief economist at Northern Trust in Chicago. “The strategy is very clear. They are willing to go a long way with the tariffs because they feel our relative pain will be lower than it will be for other countries.”

The good fight?

Trump has believed for decades that other countries take advantage of the United States. And economists generally agree the U.S. economy is more open and has fewer trade barriers.

“It’s not that there are not legitimate grievances,” said chief economist Richard Moody of Alabama-based Regions Financial. “The question is the best way to go about resolving them.”

The approach Trump has taken defies the traditional Washington practice of talk, talk and more talk, occasionally followed by temporary sanctions..

Already Trump has announced billions in tariffs on Chinese-made products and foreign steel. He’s also aiming to block the transfer of sensitive U.S. technologies and is threatening to slap automobile tariffs on Canada and the European Union.

Other countries have retaliated on a smaller scale, seeking to target goods such as soybeans, whiskey and Harley-Davidson HOG, -1.03% motorcycles that are largely produced in states won by Trump in the 2016 election.

That’s only spurred Trump to ratchet up the pressure:

How long can Trump stick to his guns?

Most economists see little damage to the U.S. in the short run. A protracted fight over trade could cost GDP several tenths of a percentage point, but that’s not a huge deal. Whether the U.S. grows 3% in 2018 or 2.8% doesn’t mean much in the big picture.

Alternative view:Why a major trade war could mean a ‘full-blown recession’

To be sure, some industries would lose out, and consumers and businesses might pay more for some materials or goods affected by U.S. tariffs or foreign retaliation.

Perhaps the biggest cost would be to the momentum generated by Trump’s economic policies. His tax cuts and an aggressive rollback of regulations pushed surveys of consumers and businesses earlier this year to the highest levels in almost two decades.

Now some of that optimism could be undone. U.S. stocks SPX, +0.53% DJIA, +0.40% , for instance, have faltered this year amid heightened tensions over trade. And businesspeople say they may delay or halt some big investments until they get a better idea of whether a resolution is in sight.

The longer the trade disputes drag on, the greater the damage that could be done to the U.S. economy.

Opinion: What if Trump’s fascinating economic experiment proves everyone wrong?

Still, the pressure is also on in other countries.

Douglas Porter, chief economist at BMO Capital Markets in Toronto, said Canadians are worried, especially if Trump really does target the country’s automotive industry. He said he thinks Canada is willing to compromise, but he added that Trump’s recent attacks on Prime Minister Justin Trudeau mean “it’s going to be tougher to make concessions in the short term.”

Chinese leaders, for their part, had figured Trump would cave in because of the congressional elections in November. So far he’s shown no sign of doing that.

“You get bad outcomes because people either misread signals or assume the other person will back down,” Faucher said.

Now even the Chinese are starting to wonder. Worries about a lengthy trade dispute with the U.S. are mounting, Tannenbaum said. His recent visit to China gave him the sense “that there is a certain urgency to get this resolved, in an orderly way, relatively quickly,” if it’s possible.