WASHINGTON (Reuters) – U.S. retail sales increased in March, mostly boosted by higher gasoline and food prices, but consumers are showing signs of cutting back on discretionary spending amid high inflation.

Retail sales rose 0.5% last month, the Commerce Department said on Thursday. Data for February was revised higher to show sales gaining 0.8% instead of 0.3% as previously reported.

Economists polled by Reuters had forecast retail sales increasing 0.6%, with estimates ranging from as low as a 0.3% decline to as high as 2.2% jump.

Gasoline and food accounted for bulk of the increase in sales last month. Retail sales are mostly made up of goods and are not adjusted for inflation. Restaurants and bars are the only services category in the retail sales report.

Monthly consumer prices increased by the most in 16-1/2 years in March as Russia’s war against Ukraine boosted the cost of U.S. gasoline to record highs. Prices at the pump on average soared to an all-time high of $4.33 per gallon in March, according to AAA.

“Higher prices for necessities, such as food and gas, mean consumers have fewer dollars left to spend at other retailers,” said Sam Bullard, a senior economist at Wells Fargo in Charlotte, North Carolina.

Though soaring prices are reducing consumers’ purchasing power, rising wages are helping to cushion some of the hit from high inflation.

The unemployment rate is at a two-year low of 3.6% and there were a near record 11.3 million job openings at the end of February, which economists said made it easier for some cash-strapped Americans to take a second job or pick up extra shifts.

Tightening labor market conditions were underscored by a separate report from the Labor Department on Thursday showing initial claims for state unemployment benefits increased 18,000 to a seasonally adjusted 185,000 for the week ended April 9.

Economists had forecast 171,000 applications for the latest week. Claims have dropped from a record high of 6.137 million in early April 2020.

Better job security is also allowing some consumers to take on more debt. Another buffer against inflation is also coming from the massive savings accumulated during the pandemic.

(Reporting by Lucia Mutikani; Editing by Chizu Nomiyama)