Housing and apparel prices each climbed by 0.2 percent, the figures showed.

Core inflation was up 1.3 percent from a year earlier, the department said. The core index, which was also in line with analysts’ forecasts, was also pushed up by rises in the prices of new vehicles, shelter, medical care and airline tickets.

“I think that you are seeing inflation drift higher,” said Joshua Shapiro, chief United States economist at MFR Inc. “On the core side it is a slow drift, but it is nonetheless there. What will be important to the Fed is the mix between inflation and real growth.”

Many economists expect gasoline prices to ease over the summer. But in some regions of the country, consumers have been paying $4 or more a gallon at the pump since demand in emerging markets and turmoil in the Middle East and North Africa in the first quarter of the year sent prices higher. While consumers are feeling the strain, economists emphasized that the Federal Reserve was unlikely to take any action to relieve it by lowering interest rates or extending its quantitative easing program.

The Fed has raised its forecast of inflation, projecting that prices could rise 2.1 to 2.8 percent this year, mostly because of higher oil prices, although it stressed that those increases would subside. In April, the Fed’s policy-making body voted to continue several stimulus policies, like keeping short-term interest rates near zero. In a statement, the committee said it expected inflation from higher prices in energy and other commodities to be “transitory.”

Mr. Hoffman said core inflation, which is the rate the Fed focuses on, had edged up in the last year, meaning the Fed could put deflation concerns behind it. The 1.3 percent rate in the latest report was still below the unofficial target of the central bank of 2 percent or less.

“It is still not of concern to the Fed,” Mr. Hoffman said. “We are sort of in the middle, not going up too fast to worry the Fed about inflation.”