American employers added 4.8 million jobs in June, and the unemployment rate fell more than 2 percentage points to 11.1%, the federal government said Thursday, as companies continued to bring back workers after historic job losses during the coronavirus pandemic.

The job gains came as more businesses reopened after shutting down to stem the spread of the virus. But unemployment remained at levels not seen since World War II, and a recent surge in coronavirus cases threatens the budding recovery, economists warned.

The jobless rate ticked down from 13.3% in May and a peak of 14.7% in April, which was the highest level since the government began tracking such data in 1948. There are still 17.8 million people without work, according to the Bureau of Labor Statistics.

It’s too soon to tell how the resurgence of the virus has affected employment. The data released Thursday are based on a U.S. Census Bureau survey of about 60,000 households conducted in mid-June, before some states closed bars again or postponed plans to lift other restrictions.

More timely figures, also released Thursday by the Labor Department, showed that 1.4 million Americans applied for unemployment assistance last week, a sign that mass layoffs continue.

“Despite continued massive layoffs, the reopening is working as millions of jobs have come back,” Joel Naroff, president and founder of Naroff Economic Advisors in Bucks County, wrote Thursday. “That said, we need to put things into perspective. In May and June, firms have added back 7.5 million workers, which is phenomenal. However, that is only one-third the 22.2 million jobs that were lost in March and April, so we still have a very long way to go.”

Restaurants and bars, which were particularly hit hard by state shutdown orders, drove much of the job market improvement, hiring 1.5 million people in June, the BLS said. Still, that industry is down 3.1 million jobs since February. Such services rely heavily on spending by high-income people — a group whose consumption has especially tailed off.

About 740,000 people were hired or rehired in retail, 568,000 in education and health services, and 356,000 in manufacturing, the BLS reported.

Outdoor dining and retail returned to the Philadelphia region in June, giving a boost to businesses that were limited to online ordering and delivery. That allowed some businesses to bring back laid-off workers.

Valerie Safran, co-owner of several 13th Street restaurants in Philly — such as Barbuzzo, Little Nonna’s, and Bud & Marilyn’s — said she recently rehired roughly 50 people, bringing back more than 30% of her staff to help with outdoor dining.

“We have had a really great couple of weeks of outdoor dining. The weather has been cooperative,” she said. Sales “are still off by at least 50%, but it’s better than nothing.”

But Philadelphia and New Jersey postponed plans to allow indoor dining this week, citing a rise in coronavirus cases locally and across the country. Three states — California, Florida, and Texas — restricted restaurant and bar service after seeing a surge in infections, while other states have slowed or postponed reopening plans.

Mark Zandi, the chief economist at Moody’s Analytics, wrote this week that economic activity had taken a big hit in states with spikes in cases.

“It is increasingly clear that many governors reopened their states too quickly, reigniting the virus and hurting their economies,” Zandi wrote.

Another concern is the approaching “fiscal cliff,” when the federally financed extra $600 a week in unemployment benefits expires at the end of the month. Congress is debating how or whether to extend the help after approving a more than $2 trillion stimulus package in March.

In addition to layoffs, companies have cut hours and wages, so about a third of the workforce is struggling, Zandi said. If Congress doesn’t provide more financial help, workers will have no choice but to cut spending and stop paying their bills, he said.

“They’re going to run right into the bunker, and the economy goes back into recession,” Zandi said.

The monthly jobs report does not include details on state unemployment rates, with those figures to be released later this month. In May, Pennsylvania’s unemployment rate improved slightly to 13.1%. The unemployment rate was 15.2% in New Jersey.

Across the nation, the unemployment rates dropped in June for adult men (10.2%), adult women (11.2%), teenagers (23.2%), whites (10.1%), Blacks (15.4%), and Hispanics (14.5%). The jobless rate for Asians (13.8%) changed little over the month, the BLS said.

Consumers have slowly reopened their wallets, but the wealthy are still spending much less than before the pandemic, according to Opportunity Insights, a Harvard-based research group. By mid-June, spending by high-income consumers had fallen 13.1% from January, while low-income spending was down just 3.1%, according to an analysis of card purchasing data.

That has harmed low-wage, service-sector workers, who count on high-salaried people to spend their money, said Michael Stepner, a University of Toronto economist and a lead investigator for the project at Opportunity Insights. The labor market might not fully recover until the wealthy feel safe enough to eat out, see shows, or travel again.

“There’s been a general trend in the labor market; there’s been this hollowing out of the middle class,” Stepner said. “And what that creates is vulnerability for people at the bottom, whose livelihood is really dependent on the spending of those high-income folks. And we’re seeing that vulnerability play out in real time.”