But the US Treasury Department has warned against spending excessively on anything other than the war against terrorism.
"Hard working Americans created a unified budget surplus in Washington," said Treasury Secretary Paul O'Neill.
"Reigniting our vibrant economy, while controlling spending, is the essential ingredient to ensuring budget surpluses for years to come."
Above expectations
The US government's budget surplus of $127.2bn (£88.77bn) for the fiscal year that ended on 30 September was lower than last year's $236.9bn, the Treasury Department said Monday.
But it was also well above the Congressional Budget Office forecast of $121bn.
And the surplus was the second largest so far, marking the fourth annual surplus in a row after 28 years of deficits.
Even the September surplus exceeded expectations at $35.39bn.
Additional spending
"It was an important accomplishment that the federal government recorded the second largest surplus in history and paid down $90bn in debt last fiscal year," said the budget director Mitch Daniels.
"However, circumstances have changed radically. We must make sure that this is not the last surplus by limiting additional spending to purposes directly related to the nation's battle against terrorism."
It is widely believed that, following 11 September, it will be difficult to reach earlier forecasts of a $176bn surplus in 2002.
Extra government spending on emergency stimulus packages could erode the surplus altogether and send the US back into the red, analysts predicted.