The federal deficit is running sharply lower than last year even though spending in August set an all-time high, the government reported Thursday.

The Treasury Department said that the deficit through the first 11 months of this budget year totaled $274.4 billion, down 9.8 percent from the same period a year ago.

Analysts believe the deficit for all of 2007 will actually be even lower because they are forecasting a sizable surplus in the final month, reflecting in part timing issues that caused about $44 billion in Social Security and Medicare payments that normally would have been made in September to be shifted into August.

The Congressional Budget Office is forecasting that when this budget year wraps up on Sept. 30, the deficit will total $158 billion, down by 36.2 percent from last year's $248.2 billion deficit.

The government's books have been helped this year by record flows of tax receipts, which have continued even though economic growth has been reduced by a serious slump in housing.

A deficit of $158 billion would be the best showing since the budget was actually in balance for four years. The last surplus was in 2001, President Bush's first year in office.

While forecasts had projected that government surpluses would total $5.6 trillion over the next decade, the 2001 recession, spending on the wars in Iraq and Afghanistan and the president's first-term tax cuts all combined to wipe out those surpluses.

Republicans contend that Bush's tax cuts are a major reason that government receipts are so strong now, but Democrats contend that the tax cuts are providing very little economic stimulus and that revenues are simply rebounding to more normal levels after slumping earlier in the decade.

The deficit hit an all-time high in dollar terms in 2004 at $413 billion and has been declining since then. The administration is projecting that the government's books will be in surplus by 2012 if Congress follows Bush's recommendations on spending restraint. However, the Democratic-controlled Congress is pushing for higher spending for the budget year that begins Oct. 1. Bush has pledged to veto spending bills that exceed his requests.

For August, the deficit totaled $116.9 billion. However, about $44 billion of that figure reflected payments for Social Security and Medicare that were mailed in August because Sept. 1 fell on a Saturday and Labor Day came on Sept. 3.

Through the first 11 months of the current budget year, receipts total a record $2.282 trillion, up 7.5 percent from last year, while outlays totaled a record $2.557 trillion, up 5.3 percent from last year.