Medicare’s long-term health is starting to look a little better, the government said Friday, but both Social Security and Medicare are still wobbling toward insolvency within two decades if Congress and the president don’t find a way to shore up the trust funds established to take care of older Americans.

Medicare’s giant fund for inpatient care will be exhausted in 2026, two years later than estimated last year, while Social Security’s projected insolvency in 2033 remains unchanged, the government reported.

An overall slowdown in health care spending is helping Medicare. Spending cuts in President Barack Obama’s health care law are also having a positive impact on the balance sheet, but they may prove politically unsustainable over the long run.

The relatively good news about two programs that provide a foundation of economic security for nearly every American family is a respite, not a free pass. Program trustees urged lawmakers anew to seize a current opportunity and make long-term changes to improve finances. Action now would be far less jarring than having to hit the brakes at the edge of a fiscal cliff.

Politically, however, Friday’s positive report and the absence of a crisis could make legislative action less likely, especially in light of the lack of trust between President Barack Obama and Republicans in Congress. No end is in sight for the partisan standoff over what to do about Social Security and Medicare, two of the government’s costliest programs, and the mammoth budget deficits they help fuel.

Still, fresh warnings were sounded.

“Under current law, both of these vitally important programs are on unsustainable paths,” said economist Robert D. Reischauer, one of two independent public trustees overseeing the annual reports.

The window for action “is in the process of closing even as we speak,” said his counterpart, Charles Blahous III, also a prominent economist.

Social Security provides monthly benefit checks to about 57 million people, including 40 million retirees and their dependents, 11 million disabled workers and dependents and 6 million survivors of deceased workers. Medicare covers nearly 51 million people, mainly retirees but also disabled workers.

If the funds ever become exhausted, the nation’s two biggest benefit programs would collect only enough money to pay partial benefits.

Social Security could cover only about 75 percent of benefits, while Medicare’s fund for hospital and nursing rehabilitation care could pay 87 percent of costs.

With 10,000 baby boomers turning 65 every day, America’s aging population is straining both programs.

While the combined Social Security fund was projected to be depleted in 2033, the trustees warned that the threat to one of its component trust funds that makes payments to workers on disability is much more urgent. They projected that the disability trust fund would deplete its reserves in just three years, in 2016. That date is unchanged from last year’s report.

Blahous said he hoped that would prod lawmakers to act on the broad challenges facing Social Security.

The remaining trustees are senior administration officials, including Treasury Secretary Jacob Lew and Health and Human Services Secretary Kathleen Sebelius. While acknowledging the need for long-term changes to improve program finances, they used the occasion of the annual report to assert that Obama’s policies are working, particularly his health care overhaul.

White House spokesman Josh Earnest saw validation in the reports, too. The Medicare numbers showed Obama’s health overhaul “is having a positive effect on the deficit,” he said, while the Social Security report supports the president’s contention that the retirement program is “not driving our short-term deficit.”

Motivation for both sides to tackle federal spending deficits —always risky because of the pain that could cause voters — has already declined because the improving economy has also pushed projected federal deficits downward. This year’s shortfall is now expected to be $642 billion, down from $1.1 trillion last year.

Obama has proposed significant changes to both benefit programs, in the context of budget talks. Those include a formula change that would pare cost-of-living increases for retirees, and nearly $400 billion in Medicare savings, mainly from cuts to service providers. Congressional Republicans want to do more, particularly on Medicare, by converting the program into a private insurance system.