Consumers picked up their spending from May to June, underscoring their resilience despite painfully higher prices at the gas pump and in grocery aisles and allaying fears that the economy might be on the verge of a recession.

U.S. retail sales rose 1% in June, from a revised decline of 0.1 % in May, the Commerce Department said Friday.

The figures aren’t adjusted for inflation and so largely reflect higher prices, particularly for gas. But they also show that consumers are still providing crucial support for the economy and spending on such discretionary items as furniture, restaurant meals and sporting goods.

At the same time, last month’s spending gain is modest enough that it likely won’t encourage the Federal Reserve to raise interest rates even more aggressively. Stock prices rose after the report’s release.

“People did not fold in the face of the Ukraine shock and the subsequent surge in food and energy prices,” said Ian Shepherdson, chief economist at Pantheon Macroeconomics. “Instead, they ran down a small part of their pandemic savings in order to keep up their discretionary spending.”

Consumers still have significant savings, on average, bolstered by pandemic-era government relief checks and strong hiring and pay gains. JPMorgan executives said Thursday that their customers are still breaking out their credit and debit cards at a healthy pace.

Kathy Bostjancic, chief U.S. economist at Oxford Economics, said that excluding inflation, retail sales still rose about 0.3% in June, up from a contraction of 0.4% in May. She expects the economy to grow at a slim 0.5% annual rate in the April-June quarter, after shrinking in the first three months of the year.

The report showed consumers’ ongoing appetite for non-essentials like gadgets and furniture. In fact, sales at furniture stores rose 1.4%, while consumer electronics stores rose 0.4%. Online sales showed resurgence, posting a 2.2% increase. Business at restaurants was up 1%. But department stores took a hit, posting a 2.6% decline.

The solid figures bode well for the back-to-school shopping season, the second largest sales period behind the winter holidays. Mastercard SpendingPulse, which tracks spending across all payment forms including cash, forecasts that back-to-school spending will be up 7.5% from July 14 through Sept. 5 compared with the year-ago period when sales rose 11%.

But spending is volatile. The latest round of retail earnings reports released in May showed some slowing of spending, particularly with low-income shoppers. RH, an upscale furniture chain, cut it sales outlook for the year last last month, pointing to deteriorating macro-economic conditions. It cited higher mortgage rates, which are slowing sales of luxury homes, indicating that even wealthy shoppers are pulling back.

Nevertheless, the overall solid spending came even as shoppers were confronted with high prices in all areas. U.S. inflation surged to a new four-decade high in June because of rising prices for gas, food and rent, squeezing household budgets and pressuring the Fed to raise rates aggressively — trends that raise the risk of a recession.

The government’s consumer price index soared 9.1% in June compared with a year ago, the biggest yearly increase since 1981, with nearly half of the increase due to higher energy costs. The year-over-year leap in consumer prices last month followed an 8.6% annual jump in May. From May to June, prices rose 1.3%, following a 1% increase from April to May.

Some economists believe inflation might be reaching a short-term peak. Gas prices, for example, have fallen from $5 a gallon reached in mid-June to an average of $4.57 nationwide Thursday — still far higher than a year ago.