The District posted a $417 million surplus last fiscal year, powered by $27 million in surprise revenues from fines and particularly strong sales and estate tax collections.

The city formally announced the surplus -- $327 million of which was purely local money -- on Tuesday as it unveiled its annual audit.

"This is affirmation that our economic development strategies are working and shows that we are one of the nation's most financially sound jurisdictions," Mayor Vincent Gray said in a statement ahead of a formal news conference to announce the audit's findings.

Fines and forfeits -- most of which were generated by the scores of traffic cameras the city has deployed -- accounted for $181 million of the $6.4 billion in local dollars the District collected in the 2012 fiscal year. The city had initially budgeted for $138 million in revenues from fines and forfeits before revising its estimate to $154 million.

Estate taxes were also key: The District anticipated $50 million in such revenues but ultimately collected $103 million.

And although some sales taxes fell -- including alcoholic beverage and cigarette levies -- the city still recorded a $68 million surplus in that category.

But the city also said it underspent its budget by 1.8 percent, saving $117 million in local and federal funds. Another $34 million in other, more technical adjustments helped account for the excess cash.

Word of the surplus is certain to set off a bruising political battle between Gray, who insists all of the surplus must go to building up the city's emergency reserves until the District has enough money to operate for two months without revenue, and lawmakers, many of whom have said they'd like to restore previous cuts to government services.

Gray said Tuesday he expected the city's fund balance -- its savings account -- to climb to $1.5 billion, up from $1.1 billion a year ago, and his aides said the District is within $300 million of having enough cash on hand to run the D.C. government for a two-month span without any revenues.

As recently as 1996, the fund balance had a deficit of $518 million.