WASHINGTON (Reuters) - U.S. producer prices increased more than expected in May, leading to the biggest annual gain in nearly 6-1/2 years, the latest sign of a gradual building up of inflation pressures.

The Federal Reserve raised interest rates for a second time this year on Wednesday and forecast two more rate hikes. The U.S. central bank noted that overall and underlying inflation measures had moved closer to its 2 percent goal.

“The Fed is on the right course with its gradual pace of rate hikes because the inflation heat may yet lead to fire and the risk that monetary policy has to move faster and put the long economic recovery in jeopardy,” said Chris Rupkey, chief economist at MUFG in New York.

The producer price index for final demand rose 0.5 percent last month, boosted by a surge in gasoline prices and continued gains in the cost of services, the Labor Department said. The PPI edged up 0.1 percent in April. In the 12 months through May, the PPI increased 3.1 percent, the largest advance since January 2012. Producer prices rose 2.6 percent year-on-year in April.

Economists had forecast the PPI gaining 0.3 percent from the prior month and rising 2.8 percent from a year ago.

A key gauge of underlying producer price pressures that excludes food, energy and trade services nudged up 0.1 percent last month. The so-called core PPI rose by the same margin in April. In the 12 months through May, the core PPI rose 2.6 percent after advancing 2.5 percent in April.

The renewed upward trend in producer prices strengthens expectations that inflation will pick up this year.

The Fed’s preferred inflation measure, the personal consumption expenditures (PCE) price index excluding food and energy, increased 1.8 percent year-on-year in April after a similar gain in March.

New projections from Fed officials on Wednesday indicated that the core PCE price index would slightly run above the 2 percent target.

FILE PHOTO: A woman shops at an H&M store in New York City, U.S. December 23, 2017. REUTERS/Stephanie Keith/File Photo

The dollar reversed losses against a basket of currencies following the Fed’s rate decision while prices for U.S. Treasuries fell. Stocks on Wall Street fell marginally.

STEEL PRODUCTS PRICES SURGE

Regional factory surveys have shown an acceleration in raw material prices this year. So far, manufacturers have not passed on these higher costs to consumers. A worsening worker shortage is expected to push up wages. This together with expensive raw materials will likely squeeze profit margins and probably force businesses to raise prices.

A report on Tuesday showed monthly consumer prices rising moderately in May.

In May, prices for goods surged 1.0 percent, accounting for 60 percent of the rise in the PPI. Goods prices were unchanged in April. In May, they were boosted by a 9.8 percent jump in the price of gasoline. Wholesale gasoline prices slipped 0.4 percent in April.

Prices for steel mill products surged 4.3 percent in May, the largest rise since February 2011, likely reflecting steel and aluminum import tariffs imposed in March by the Trump administration. The cost of these products could rise further after the government this month widened the duties to imports from the European Union, Canada and Mexico.

“The inflation impact of the steel and aluminum tariffs, though likely moderate, will be more visible in the second half of this year,” said Ryan Sweet, a senior economist at Moody’s Analytics in West Chester, Pennsylvania.

Wholesale food prices edged up 0.1 percent last month after declining 1.1 percent in April. Excluding food and energy, goods prices increased 0.3 percent, rising by the same margin for a third straight month.

The cost of services increased 0.3 percent after nudging up 0.1 percent in April. Services were driven by a 0.9 percent rise in margins for trade services.

The cost of healthcare services ticked up 0.1 percent after falling 0.2 percent in April. Those costs feed into the core PCE price index. Economists said factoring in the PPI and CPI data, they expected the monthly core PCE price index rose 0.2 percent in May, which would push the annual increase to 1.9 percent.

“Medical care pricing looked weak in May, but we see firmness in other inputs related to used vehicle prices, airfares, and prices for various financial services,” said Daniel Silver, an economist at JPMorgan in New York.

The Commerce Department will publish May PCE inflation data on June 29.