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

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

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

But the recovery is far from complete. Output is significantly below where it would be had growth continued on its pre-pandemic path, and other economic measures remain deeply depressed, particularly for certain groups: The United States has nearly 7 million fewer jobs than before the pandemic. The unemployment rate for Black workers in June was 9.2%.

"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."

For Sarah Ladley, the economy's spring reawakening was a glimmer of hope after a brutal year for her business.

Ladley, 33, started selling banana-based frozen treats out of her Denver food truck nearly a decade ago, just after she graduated from college. The pandemic nearly wiped her out: She made it through last year with the help of a loan through the Paycheck Protection Program, but the business lost money. With pandemic restrictions still in place early this year, she began looking for another job to pay the bills.

Instead, the phone began ringing with people looking to hold events.

"All of a sudden in May, it was like the floodgates opened," she said.

Now Ladley has a different set of problems. Business has rebounded, though not all the way, and she is having trouble fulfilling demand. She had to change the cups she uses after a vendor ran out, stores will sometimes be out of the fruit she needs and she has struggled to hire workers amid competition from businesses that can offer higher pay and year-round employment. She says she has had to turn away business to avoid burning out her limited staff.

"Things definitely aren't normal, but even if they were normal, I wouldn't be able to handle it," she said.

Indeed, the economy's second-quarter 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. Inventories fell and imports rose as companies turned to overseas suppliers and their own warehouses to meet demand where domestic producers could not. And despite a red-hot housing market, residential construction fell 2.5% in the second quarter as builders struggled to get materials and workers.

Those issues, combined with a rush of consumer demand, contributed to faster inflation in the second quarter. Consumer prices rose 1.6% from the first quarter of the year to the second. Without adjusting for inflation, economic output rose 3.1%.

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 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."

Brandon Lindley is watching the delta variant news with mounting concern. He and his husband, Raphael Polito, own retail stores in California and Arizona selling designer flip-flops and other tourism-oriented products. After a disastrous 2020, business has picked up in California this year, but they are grappling with supply-chain and labor issues, and their store in Scottsdale, Arizona, is still struggling. Business has softened since July 4, which Lindley suspects could reflect concern over the new variant.

"Everyone's a little on edge," he said. "They don't know what's coming down the pipeline."

There is little evidence so far that either the delta variant or inflation are making a dent in consumer demand overall. Consumer spending rose 2.8% in the second quarter, and more recent data from private-sector sources has yet to show a significant slowdown.

Spending on services was particularly robust in the second quarter as widespread vaccinations and falling coronavirus cases led Americans to return to restaurants, nail salons and other in-person activities. But goods spending remained strong as well, reflecting the strong financial position of many households after successive rounds of government aid, said Aneta Markowska, chief financial economist for Jefferies, an investment bank.

Personal income after taxes fell from the first quarter, when stimulus payments provided a temporary lift, but is still 6.4% above its pre-pandemic level after adjusting for inflation. And Americans are collectively sitting on trillions more in savings than they had before the pandemic.

"The story of the last two decades was that every time you got a price increase somewhere, it caused immediate demand destruction because household incomes and balance sheets were so constrained," Markowska said. "Today that's not the case. Household finances are in the best shape they've been in decades."

Still, the recovery has been highly unequal. Data from Affinity Solutions, which tracks the credit and debit card transactions of 90 million U.S. consumers, shows that recent increases in spending have been driven by high-income households. Employment among people with a college degree — many of whom could work from home — fell less in the pandemic and has already returned to its previous level, while employment among those with a high school diploma or less remains millions of jobs below that bench mark.

"The people who were working and did not have an interruption in their pay were able to save more money and now have this pent-up demand," said Kristen Broady, a Dillard University economist and a fellow at the Brookings Institution. For low-income households who fell behind on rent or bills during the pandemic, she said, "their situation is even worse than it was before."

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 is scheduled to end this week. And there is no sign that Congress intends to pass a fourth round of direct checks to households.

Nela Richardson, chief economist for ADP, the payroll processing firm, said the second quarter might 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?"