WASHINGTON — The federal government is expected to finish its fiscal year with a relatively modest budget deficit as the gap between revenue and spending continues a sharp decline, the Congressional Budget Office said Wednesday.

The improvement in the government’s financial health has shifted political debate in Washington, and arguments on the midterm campaign trail, from the level of federal spending to the uses of that money. It has frustrated economists who argue that the government’s restraint has held back the economic recovery.

The budget office said that it now predicted a federal deficit of $506 billion during the fiscal year that runs through the end of September, modestly increasing its April projection that spending would exceed revenue by $492 billion. The change was attributed to lower-than-expected corporate income tax receipts.

Both figures are significantly lower than the $680 billion deficit during the previous fiscal year. This would also be the fifth consecutive year the deficit has declined as a share of the nation’s gross domestic product, from 9.8 percent in the 2009 fiscal year to a projected 2.9 percent during the current fiscal year. That is below the average deficit of 3.1 percent of economic output over the last four decades.