PARIS — The global economy will grow close to 4 percent this year and next, better than previously anticipated, according to the OECD, which added a warning that a trade war could roll back the gains seen in recent years.

Upgrading its forecasts, the Paris-based group in part cited U.S. tax cuts for the better numbers. It sees the world economy expanding 3.9 percent in both 2018 and 2019, the strongest since 2011. That’s up from 3.7 percent and 3.6 percent, respectively, from its November projections.

But its brighter outlook came with a major caveat in the wake of the U.S. decision to slap import tariffs on steel and aluminum and the threat of retaliation by China, the European Union and others. The OECD, which groups 35 developed economies, called on the world’s major nations to avoid a dispute that could impede trade, demand, competition and, ultimately, the health of the global economy.

“Trade protectionism remains a key risk that would negatively affect confidence, investment and jobs,” it said Tuesday. “Governments of steel-producing economies should avoid escalation and rely on global solutions.”

On its latest forecasts, the OECD said the tax cuts in the U.S. will boost business investment and could add as much as three-quarters of a percentage point to growth this year and next in the world’s largest economy. The outlook for 2018 U.S. expansion was upgraded to 2.9 percent from 2.5 percent, and the euro area was lifted to 2.3 percent from 2.1 percent. The better global growth will be accompanied by a “modest” pickup in inflation, it said.