Maryland finished last fiscal year $400 million in the black, according to figures released Thursday, but residents still face the prospect of higher taxes in coming months as officials struggle to lift the state out of the economic doldrums.

The state's general fund revenue was $314 million more than expected, said Comptroller Peter Franchot, which, coupled with transfers and other fiscal moves, amounted to the better-than-expected results.

However, the state's tax collector also said that corporate income and sales and use tax revenues were $92 million less than expected -- and preached caution to lawmakers on the verge of returning for a special session in the fall.

"While these numbers provide a measure of relief in the midst of challenging times, the events of recent months serve as a sobering reminder that we must maintain a cautious fiscal course, one that emphasizes savings and efficiencies rather than new spending," he said. "Given the magnitude of the fiscal and economic challenges that lay ahead, both for our state and for the country, I firmly believe that this fund balance must be saved and not spent."

After the fiscal year ended June 30, the U.S. credit rating was downgraded for the first time and the Maryland bond rating was assigned a negative outlook because of deep ties to the federal work force.

And Maryland is facing a $1.2 billion shortfall, which Gov. Martin O'Malley has said will require tax increases to plug.

In recent days, budget surpluses have been a hot topic among local officials ?-- and political rivals across the Potomac.

Virginia Gov. Bob McDonnell recently announced a half-billion-dollar budget surplus from last fiscal year, drawing the scorn of Maryland Democrats who questioned his math. Meanwhile, Virginia Republicans have scoffed at the next round of tax increases expected in Maryland.

Of the $545 million surplus, $311 million came from a revenue surplus and $234 million came from budget savings and balances, he said.

With Maryland's transportation trust fund almost empty -- O'Malley has spent $700 million of the funds reserved for road and rail maintenance over the last two years -- liberal lawmakers are planning to push for an increase in the state's 23.5-cent-per-gallon gasoline tax during a special session in October.

Lawmakers also are exploring a bevy of new taxes that would apply to consumer services, such as accounting and landscaping, as well as snack food and prescription drugs.