U.S. consumer sentiment rose in early August to a three-month high on firmer expectations about the economy and personal finances.

Inflation expectations were mixed, with consumers boosting their longer-term views for prices slightly, while reducing their year-ahead outlook for costs.

The University of Michigan’s preliminary sentiment index rose to 55.1 from 51.5 in July, data showed Friday. Consumers expect prices will climb at an annual rate of 3% over the next five to 10 years, from 2.9% in July. They see costs rising 5% over the next year, the lowest since February, compared to last month’s 5.2%.

The sentiment gauge exceeded all but one forecast in a Bloomberg survey of economists who had a median projection of 52.5.

Government figures earlier this week showed that consumer prices rose 8.5% in July from a year ago, down from a 40-year high and reflecting a drop in energy costs. That said, prices for other necessities like food and shelter continue to rise, suggesting that Federal Reserve will continue to raise interest rates to curb inflation.

The gain in sentiment was driven solely by a pickup in the outlook. The university’s measure of expectations increased to a three-month high of 54.9 from 47.3 in July.

Meanwhile, the gauge of current conditions fell to 55.5 from 58.1.

“In spite of this strength in the labor market and some signs of improvement in inflation, consumer sentiment remains very low by historical standards,” Joanne Hsu, director of the survey, said in a statement. “In the current context, even strong labor markets have been raised as negative news for business conditions, as consumers recognize the challenges businesses may face with hiring.”

The university’s index of consumers’ economic outlook over the coming year improved to a four-month high, while their expectations for personal finances were the firmest in three months.

--With assistance from Jordan Yadoo.

This article was provided by Bloomberg News.