WASHINGTON (AP) — Consumer prices rose 2.7 percent in August from a year earlier, with higher housing and gasoline costs driving most of the increase.

The Labor Department said Thursday that the consumer price index advanced 0.2 percent on a monthly basis. Despite the monthly gain, annual inflation softened from the 2.9 percent pace set during the 12 months ended in July. The more modest inflation rate should help to boost the spending power of Americans whose wage gains had been eaten up by higher prices.

Core prices, which exclude the volatile food and energy categories, increased 0.1 percent in August and 2.2 percent from a year ago.

Gas prices jumped 3 percent last month and 20.3 percent on the year, while shelter expenses have climbed 3.4 percent annually.