Vaccinations and federal aid helped lift the U.S. economy out of its pandemic-induced hole this spring. The next test will be whether that momentum can continue as coronavirus cases rise, masks return and the government helps wanes.

Gross domestic product, the broadest measure of economic output, grew 1.6 percent in the second quarter of the year, the Commerce Department said Thursday, up from 1.5 percent in the first three months of the year. On an annualized basis, second-quarter growth was 6.5 percent.

The growth, fueled by strong consumer spending and robust business investment, brought output, adjusted for inflation, back to its pre pandemic level. That is a remarkable achievement, exactly a year after the economy’s worst quarterly contraction on record. After the last recession ended in 2009, G.D.P. took two years to rebound fully.

G.D.P. rebounded much faster than it did in the Great Recession

+

15

%

2001

1980

Cumulative percent change in G.D.P.

from the start of the last five recessions

1990

+

10

+

5

2007

0

2020

5

10

5

quarters since

recessions began

10

15

20

Note: Gross domestic product is adjusted for inflation and seasonality. Recessions are labeled by the years they started.

Source: Bureau of Economic Analysis

By Karl Russell

But the second-quarter figure fell short of economists’ forecasts, and the recovery is far from complete. Output is significantly below where it would be had growth continued on its pre pandemic path. Other economic measures remain deeply depressed, particularly for certain groups: The United States still has nearly seven million fewer jobs than before the pandemic. The unemployment rate for Black workers in June was 9.2 percent.

“The good news is this is all occurring much more rapidly than after the financial crisis,” said Diane Swonk, chief economist for the accounting firm Grant Thornton. “The bad news is the pain was much worse.”

Growth might have been stronger had it not been for supply-chain disruptions and labor challenges that made it difficult for many businesses to keep their shelves stocked and their stores staffed. Those issues, combined with a rush of consumer demand, contributed to faster inflation in the second quarter. Consumer prices rose 1.6 percent from the first quarter of the year to the second. Without adjusting for inflation, economic output rose 3.1 percent.

Now a new threat is emerging in the highly contagious Delta variant of the coronavirus, which has led to a surge in cases in much of the country. The Centers for Disease Control and Prevention recommended this week that even vaccinated people should wear masks indoors in some parts of the country, and some mayors and governors have reimposed mask mandates.

Few economists expect a return to widespread business shutdowns or stay-at-home orders. But if the resurgent virus leads to renewed caution among consumers — a reluctance to dine at restaurants, hesitation about booking a late-summer getaway — that could weaken the recovery at a crucial moment.

“The reason that is concerning is that this burst of activity around reopening has been driving the economy the past couple of months,” said Michelle Meyer, head of U.S. economics at Bank of America. “Even a modest change in behavior could show up more meaningfully this time around.”

And this time, workers and businesses may have to face the pandemic without much help from the federal government. Roughly half the states have cut off enhanced unemployment benefits in recent weeks, and the programs are set to end nationally in September. The Paycheck Protection Program, which helped thousands of small businesses weather the crisis, is winding down. A federal eviction moratorium will end this week if the Biden administration doesn’t act to extend it. And there is no sign that Congress intends to pass the fourth round of direct checks to households.

Nela Richardson, the chief economist for ADP, the payroll processing firm, said the second quarter may stand as a high-water mark for the recovery, when federal aid was still flowing and when vaccinations and the lifting of restrictions gave people an opportunity to spend.

“All the winds were going in one direction, which was to push the economy forward,” she said. “The more interesting question is: Where do we go from here?”