Consumer prices climbed 2.9 percent in July from a year earlier, a rate of inflation that suggests Americans are earning less than a year ago despite an otherwise solid economy.

The Labor Department said Friday that the consumer price index ticked up 0.2 percent in July. Annual inflation matched the 2.9 percent pace from June, which had been the highest level since February 2012. Core prices, which exclude the volatile food and energy categories, rose 0.2 percent in June and 2.4 percent from a year earlier. Core prices have risen at the fastest annual pace since September 2008.

"For Americans to benefit more from the expansion, real wage growth needs to be positive as it usually is in this phase of an expansion," said Robert Frick, a corporate economist with Navy Federal Credit Union.

Most of July's increase in consumer prices came from higher housing costs. Prices for energy, medical care and apparel slipped in July, while food expenses rose slightly.

Adjusted for inflation, average weekly earnings have fallen 0.1 percent in the past 12 months.

During the past year, higher prices for oil, gasoline and transportation have caused the inflation rate to jump after it had hovered at relatively low levels for the previous six years. The sudden increase in prices has not only wiped out average growth, but it also creates pressure for the Federal Reserve to hike short-term interest rates so that inflation stays close to the U.S. central bank's 2 percent target.

The Fed has already raised rates twice this year and another two rate hikes are expected before the start of 2019. By making it more expensive to borrow, the Fed would likely tamp down on inflation as well as economic growth, making it more difficult for President Donald Trump to achieve the sustained 3 percent gains in gross domestic product that he has promised voters.

Rising gasoline costs have complicated the inflation picture. Gas costs have surged 25.4 percent in the past year, but they tumbled 0.6 percent in July, which could mean that prices at the pump may be stabilizing.