Budget cuts and tax increases over the last few years have helped improve the federal government’s financial picture for now — but over the next few decades big deficits will return, deepened partly by all of the debt racked up over the last seven years, the Congressional Budget Office reported Tuesday.

“CBO’s extended baseline projections show a substantial imbalance in the federal budget over the long run, with revenues falling well short of spending,” Congress’s non-partisan scorekeeper said in its annual long-term outlook for the federal budget.

Federal debt is expected to rise from 74 percent of the gross domestic product now to 106 percent in 25 years, which is 4 percentage points higher than the CBO projected just last year. That’s due chiefly to an overall slower economy, or lower GDP, than previously thought.

To get debt back to its average of the last four decades, which was 39 percent, would require tax increases or spending cuts equivalent to 2.6 percent of GDP, or nearly half a trillion dollars a year, every year.

The good news is that interest rates are projected to be lower, which will save the government substantial money as it makes payments on the higher levels of debt.

Government spending on health care is likely to drop over the next 25 years, and as a percentage of GDP will be 1.5 percentage points less than previously thought.

Democrats claimed a victory on that score, saying that Obamacare has helped reduce the costs of care.

Rep. Steny H. Hoyer, the second-ranking Democrat in the House, called that a “bright spot” among the other gloomy projections.

“Instead of working to undermine or repeal that law, I hope House Republicans will work with Democrats to build on the savings it has achieved by identifying other ways to bring down our deficits and debt responsibly and not on the backs of the most vulnerable Americans,” the Maryland Democrat said.

CBO’s projections for lower health costs, however, were chiefly due to updates on Medicare and Medicaid, the two long-standing government health programs for the elderly and the poor.

The change in projections still means the government will be spending an ever larger share of its budget on health programs and other entitlements. Medicare and Medicaid spending combined total 4.8 percent of GDP this year, but will be 8 percent by 2039.

The biggest entitlement, Social Security, will total 4.9 percent of GDP this year and grow to 6.3 percent in 25 years.

“Today’s CBO report is a stark reminder of the urgent need for entitlement reform, because as CBO says, our current spending path is unsustainable,” said Sen. Orrin G. Hatch, Utah Republican.

The CBO report says Congress has already pared down discretionary spending — the annual budgets over which lawmakers have the most direct control. That leaves three major levers for Congress: the size of the economy, the amount of taxes the government collects and the growth of the entitlement programs that increase automatically.

The CBO said changes will have to come at some point, but they present a trade-off. Cutting spending or raising taxes now would likely hurt the economy and mean pain in the short term, but putting off the decisions until later means even greater pain in the future.