WASHINGTON, D.C. — The U.S. economy grew solidly in the second quarter, pulling the level of gross domestic product above its pre-pandemic peak, as massive government aid and vaccinations against COVID-19 fueled spending on goods and travel-related services.

The pace of GDP growth reported by the Commerce Department this week was, however, slower than economists had expected. That was because businesses had to again draw down on meager inventories to meet the robust demand. Supply constraints, which have resulted in shortages of motor vehicles and some household appliances, are making it harder for business to replenish stocks.

“The U.S. economy is off and running,” said Scott Hoyt, a senior economist at Moody’s Analytics in West Chester, Pennsylvania. “Real GDP has fully recovered what it lost in the downturn.”

Gross domestic product increased at a 6.5% annualized rate last quarter, the government said in its advance estimate of second-quarter GDP. The economy grew at a 6.3% rate in the first quarter, revised down from the previously reported 6.4% pace.

Economists polled by Reuters had forecast GDP rising at an 8.5% rate last quarter. Excluding inventories, trade and government spending, the economy grew at a 9.9% pace.

With the second-quarter estimate, the government published revisions to GDP data, which showed the economy contracting 3.4% in 2020, instead of 3.5% as previously estimated. That was still the biggest drop in GDP since 1946.

The revisions to growth in other years and quarters were minor. From 2015 to 2020, GDP increased at an average annual rate of 1.1%, unrevised from previously published estimates.

The National Bureau of Economic Research, the arbiter of U.S. recessions, declared last week that the pandemic downturn, which started in February 2020, ended in April 2020.

Even with the second quarter marking the peak in growth this cycle, the economic expansion is expected to remain solid for the remainder of this year. A resurgence in COVID-19 infections, driven by the Delta variant of the coronavirus, however, poses a risk to the outlook. Higher inflation, if sustained, as well as ongoing supply chain disruptions could also slow the economy.

The Federal Reserve on Wednesday kept its overnight benchmark interest rate near zero and left its bond-buying program unchanged. Fed Chair Jerome Powell told reporters that the pandemic’s economic effects continued to diminish, but risks to the outlook remain.

Economists expect growth of around 7% this year, which would be the strongest performance since 1984. The International Monetary Fund on Tuesday boosted its growth forecasts for the United States to 7.0% in 2021 and 4.9% in 2022, up 0.6 and 1.4 percentage points respectively, from the forecasts in April.

President Joe Biden’s administration provided $1.9 trillion in pandemic relief in March, sending one-time $1,400 checks to qualified households and extending a $300 unemployment subsidy through early September. That brought the amount of government aid to nearly $6 trillion since the pandemic started in the United States in March 2020.

Nearly half of the population has been vaccinated against COVID-19, allowing Americans to travel, frequent restaurants, attend sporting events and engage in other services-related activities that were curbed early in the pandemic.

Consumer spending, which accounts for more than two-thirds of the U.S. economy, grew at an 11.8% rate in the second quarter, boosted by demand for services. While spending on goods remained strong, the pace likely slowed from earlier in the pandemic, when Americans were cooped up at home.

The economy also received a further boost from business investment, especially on equipment, as companies ramped up production.

Though the fiscal boost is fading and COVID-19 cases are rising in states with lower vaccination rates, consumer spending will likely continue to grow.

Households accumulated at least $2 trillion in excess savings during the pandemic. Record-high stock market prices and accelerating home prices are boosting household wealth. Wages are also rising as companies compete for scarce workers amid a strengthening labor market.

A separate report from the Labor Department on Thursday showed initial claims for state unemployment benefits fell by 24,000 to a seasonally adjusted 400,000 for the week ended July 24. Economists polled by Reuters had forecast 380,000 applications for the latest week.

Claims jumped in the week ended July 17, but economists blamed the surge on difficulties stripping out seasonal fluctuations from the data. Before the pandemic auto plants would shut in early July for retooling, which caused a temporary rise in layoffs, which then reversed in the second half of July.

A global semiconductor shortage has forced some automakers to either scale back or temporarily idle production lines.

The supply constraints are making it difficult for businesses to replenish stocks. Inventories dropped at a rate of $165.9 billion in the second quarter, subtracting 1.13 percentage points from GDP growth.

Trade was a drag on GDP growth for a fourth straight quarter as strong demand sucked in imports. Expensive building materials and soaring house prices weighed on the housing market in the second quarter.