Consumer prices rose at a 2 percent annual rate for the fourth month in a row, the Bureau of Labor Statistics reported Tuesday morning, led by the increasing cost of food.

Although consumer inflation, as measured by the Consumer Price Index, slowed in July, it also has now been above 2 percent annually for longer than any time since 2012.

Core inflation, the less volatile gauge of price increases that strips out food and energy prices, is at 1.9 percent year over year, up from 1.6 percent in January.

Core inflation would have been lower, thanks to the falling price of gasoline and other forms of energy, if not for high food price hikes in the month. For the year, food prices are up 2.5 percent.

Overall, Tuesday's report will likely be taken by Janet Yellen and Federal Reserve officials as a sign that their efforts to lift the inflation rate through monetary stimulus are working. Their latest projections had inflation rising to roughly 1.5-1.7 percent only by the end of the year.

Although the CPI has been above the Fed's 2 percent target for inflation for several months, there are also signs that it might overstate the upward trend in underlying inflation. The Producer Price Index, a measure of inflation based on prices received by producers, has fallen for three straight months.

And a different indicator of consumer prices, the Personal Consumption Expenditures Index, also fell in the latest reading. The Fed and many economists view the PCE index as more accurate than the CPI, and it has not hit the Fed's 2 percent goal.

Meanwhile, inflation expectations for the next 10 years based on surveys of economic forecasters and bond market prices remain steady and low at 1.9 percent, according to the Federal Reserve Bank of Cleveland.