U.S. retail sales jumped by a record 17.7% from April to May, with spending partially rebounding after the coronavirus had shut down businesses, flattened the economy and paralyzed consumers during the previous two months.

The government’s report Tuesday showed that retail sales have retraced some of the record-setting month-to-month plunges of March (8.3 as businesses have increasingly reopened. Still, the pandemic’s damage to retail sales remains severe, with purchases still down 6.1% from a year ago.

Last month’s bounce-back comes against the backdrop of an economy that may have begun what could be a slow and prolonged recovery. In May, employers added 2.5 million jobs, an unexpected increase that suggested that the job market has bottomed out. Still, a big unknown overhanging the economy is whether early gains in job growth, retail sales and other areas can be sustained over the coming months or whether they may plateau at a low level.

“This may very well be the shortest, but still deepest, recession ever,” said Jennifer Lee, a senior economist at BMO Capital Markets. But she added that it’s “not likely that we’ll see a repeat in June as this is pent-up demand unleashed in one month.”

The virus-induced recession not only diminished spending in most sectors of the economy. It has also accelerated shifts in where people shop and what they buy. The changes forced by the coronavirus have aided online retailers and building materials stores and other outlets that stayed open during the outbreak. Other businesses are facing persistent financial strains.

Sales at non-store retailers, which include internet companies like Amazon and eBay, rose 9% in May after posting growth of 9.5% in April. They are up a sizable 30.8% from a year ago.

Building materials stores enjoyed a monthly gain of 10.9% last month and annualized growth of 16.4%. Grocers have posed a 14.4% annual sales increase, reflecting fewer people eating out at restaurants because of the pandemic.

Other sectors in retail posted spectacular growth in May yet still face an uncertain future given the blows they absorbed in March and April. Clothiers achieved a stunning 188% monthly gain but still remain down 63% over the past 12 months. Furniture store sales surged 90% last month, but they’re still down more than 21% on the year. This same pattern holds for restaurants, electronics stores, department stores and auto dealers.

Retail sales account for roughly half of all consumer spending, which fuels about 70% of total economic activity. The rest of consumer spending includes services, from cellphone and internet contracts to gym memberships and child care.

Nearly 80% of small retailers and restaurants tracked by the scheduling tool Homebase that were closed in mid-April have since reopened. Yet these smaller businesses remain under pressure. Their stresses in part reflect changes emerging as social distancing has become essential and shopping habits evolve.

One such retailer, CPW, a women’s clothing store, has been in business for 30 years on Manhattan’s Upper West Side. A three-month shutdown resulting from the virus sent the store’s sales sinking 20% to 30% even as the owner, Linda Wolff, packed and delivered orders to customer homes. Though CPW reopened for curbside pickup a week ago, Wolff said she hasn’t rung up a single such sale.

“This is my heart and soul,” she said. “I am exhausted from all the worrying.”

Some national chains, by contrast, say they have so far avoided their worst fears, a sign of how the damage from the shutdowns has varied widely across the retail landscape.

Macy’s CEO Jeff Gennette has said that his company’s reopened stores are regaining 50% of their typical business. Teen retailer American Eagle Outfitters is faring even better, averaging roughly 95% of its normal sales levels.

But analysts caution that some of the gains thus far probably reflect the impact of temporary government aid and expanded unemployment benefits in the face of a deep recession. The jobless rate is a historically high 13.3% by the government’s standard measure and an even worse 21.2% by the broadest gauge of unemployment. For now, Americans are spending disproportionately more on essentials and less on luxuries.

“Our wants and our needs have changed permanently until we find a health fix,” said Stacy Widlitz, president of SW Retail Advisors, a retail consultancy. “Shoppers are focusing on comfort, home and well-being.”

The lockdowns sent many mall-based chains further into peril. These retailers furloughed workers, slashed costs to preserve dwindling cash reserves and, in the cases of Nieman Marcus, J.Crew and JC Penney, filed for bankruptcy protection.

These troubles have contrasted with renewed strength for Walmart, Target and Home Depot, which were deemed essential businesses from the start and were allowed to remain open.

For a group of 35 non-essential retailers, including department stores and jewelry chains, combined losses reached $2.5 billion for the three-month period that ended in May, according to GlobalData Retail. That compares with their combined profit of $8.9 billion in the year-ago period.

Far better off were essential retailers, including dollar chains, discounters and food stores. For that group, profits reached $8.9 billion for the quarter, down only slightly from $9.1 billion from the year-ago period. Some of these companies had invested heavily in their online operations.

Coresight Research, a retail research firm, expects between 20,000 and 25,000 stores in the United States to close this year, about 60% of them in malls. That’s up from the firm’s previous estimate in mid-March of 15,000 closings, and it would surpass the record 9,000 stores closures last year. In the past week, Zara, Children’s Place and Signet Jewelers all announced hundreds of store closures and stressed the rising importance of their online presence.

“The retail sector was already overstored before COVID reared its ugly head,” said Craig Johnson, president of Customer Growth Partners, a retail consultancy. “This is a forced rightsizing.”