Customers pump gasoline at a gas station in the Bronx, where gas prices are over $3.00 per gallon, June 1, 2018 in New York.

U.S. consumer prices barely rose in June, but the underlying trend continued to point to a steady buildup of inflation pressures that could keep the Federal Reserve on a path of gradual interest rate increases.

The Labor Department said on Thursday its Consumer Price Index edged up 0.1 percent as gasoline price increases moderated and apparel prices fell. The CPI rose 0.2 percent in May.

In the 12 months through June, the CPI increased 2.9 percent, the biggest gain since February 2012, after advancing 2.8 percent in May.

Excluding the volatile food and energy components, the CPI rose 0.2 percent, matching May's gain. That lifted the annual increase in the so-called core CPI to 2.3 percent, the largest rise since January 2017, from 2.2 percent in May.

Economists polled by Reuters had forecast both the CPI and core CPI rising 0.2 percent in June.

The Fed tracks a different inflation measure, which hit the U.S. central bank's 2 percent target in May for the first time in six years. Economists expect the personal consumption expenditures (PCE) price index excluding food and energy will overshoot its target.

A tightening labor market and rising raw material costs are expected to push up inflation through next year. Manufacturers are facing rising input costs, in part because of tariffs imposed by the Trump administration on lumber, aluminum and steel imports.

So far, they have not passed on those higher costs to consumers. Fed officials have indicated they would not be too concerned with inflation overshooting its target. The Fed raised interest rates in June for a second time this year and has forecast two more rate hikes before the end of 2018.