WASHINGTON—When the coronavirus pandemic plunged the U.S. into a recession last year, it portended another blow to the health of the Social Security system. An anticipated decline in payroll-tax revenue and increase in disability claims were expected to erode the program’s reserves and pile pressure on the government to respond.

Instead, the near-term finances of the federal government’s retirement and disability programs appear to have weathered the storm better than many policy analysts had predicted—taking some pressure off the Biden administration and Congress to reach a long-term solution to keep them solvent.

A faster-than-expected economic recovery has bolstered the payroll taxes that help finance the programs. And new benefit claims for disability insurance, which typically jump when the economy is weak, declined for some groups as the Social Security Administration’s field offices remained closed.

“I don’t think it’s going to be as big of a hit as many people, including me, feared a year ago,” said Kathleen Romig, a senior policy analyst at the Center on Budget and Policy Priorities, a progressive Washington think tank.

SHARE YOUR THOUGHTS

What should the Biden administration do to address the looming insolvency of Social Security and Medicare? Join the conversation below.

Longer term, though, the programs are being squeezed by rising costs and declining revenue as the population ages, and they are on track to deplete their trust fund reserves in coming years as funding shortfalls widen. After that, beneficiaries would face automatic benefit cuts unless Congress steps in to shore up the program, for example by boosting the payroll tax rate, trimming benefits or delaying the retirement age.

The possibility of higher inflation could boost benefit payments, as could the long-term health problems of Covid-19 survivors, who may be more likely to claim disability benefits. Disability claims may also climb over the next year as the pandemic eases, the Social Security Administration has said.

Social Security consists of two programs, one for retirees and one for people who claim disability benefits. The program’s income comes from the 12.4% payroll tax revenue and interest from its trust funds.

In April 2020, the Social Security trustees said the costs of the combined retiree and disability programs would exceed income in 2021, forcing them to begin drawing down reserves, which would be depleted by 2035.

Those estimates were prepared before the pandemic hit, and the trustees noted that with the pandemic unfolding last spring, “the actual status of the program in the near term is almost certainly somewhat less favorable.”

By November, the Social Security Administration released an update projecting the reserves would be exhausted in 2034, just one year earlier than forecast in April. The trustees typically release an annual report on the program’s finances in April, but this year’s report has been delayed as they incorporate recent policy and pandemic-related updates.

Some scenarios were more pessimistic. An October analysis from the Bipartisan Policy Center, a centrist Washington think tank, said the economic fallout from the pandemic—if similar to the 2007-09 recession—could accelerate the depletion of the combined programs’ trust fund by as much as five years. Under that severe scenario, benefits would have been cut by 25% for retirees and 13% for disabled beneficiaries by the end of the decade without action from Congress.

Shai Akabas, the center’s director of economic policy, says he now expects the pandemic may have moved up the retirement fund’s insolvency deadline only by a year or two.

That’s due in part to the nature of the economic recovery, which has proved to be much stronger than the one that followed the previous recession.

Businesses have reopened faster than officials and forecasters projected last year, as more Americans became vaccinated and virus cases fell. Employers have added back roughly two-thirds of the 22.5 million jobs lost at the onset of the pandemic, pushing the jobless rate down to 5.8% in May from 14.8% in 2020. The relatively swift job gains have led to a sharp rebound in payroll taxes. By contrast, it took until 2013 to gain back two-thirds of the 8.7 million jobs lost during the 2007-09 recession.

In previous recessions, new applications and awards for disability insurance have tended to rise. This time, the opposite has happened: Applications were down 9% in 2020 from 2019, steeper than the downward trend before the pandemic when economic growth was brisk.

One possible reason is the closure of Social Security field offices last year during the pandemic. That appears to have led to a bigger decline in applications among people who rely more on in-person services, including the very elderly, people with limited English and homeless applicants, Ms. Romig said.

Grace Kim, Social Security’s deputy commissioner for operations, told lawmakers in April that the pandemic has also made it difficult for disability applicants to access public transportation or schedule medical appointments necessary for submitting claims.

On the other hand, inflation, which has picked up in recent months and is expected to remain elevated through the end of the year, may push costs higher. The Congressional Budget Office raised its projections for Social Security’s costs over the next decade, primarily due to higher estimates for cost-of-living adjustments for monthly benefit payments and average wages, which help determine benefit size.

While some momentum appeared to be building in recent years for an overhaul of the programs, the pandemic has shifted priorities. The Biden administration has said little about how it would tackle Social Security’s long-term funding challenges, instead focusing on efforts to shore up the economy with $4.5 trillion in spending on infrastructure and social programs.

With lawmakers facing re-election in 2022, Congress is unlikely to do much with the programs until at least 2023, said Mr. Akabas of the Bipartisan Policy Center. That could force them to make more-dramatic changes to the programs later on as the insolvency date gets closer.

“When you have limited bandwidth to deal with the panoply of economic issues facing us now, spending a ton of time on Social Security is a difficult proposition when the prospects for action look slim,” he said.

Write to Kate Davidson at kate.davidson@wsj.com