Maryland finished its budget year with a $309.7 million surplus as tax collections came in well above projections, state officials announced yesterday, reflecting a trend that has boosted revenue in Virginia and the District, as well.

The influx, $260 million more than anticipated for the fiscal year that ended in June, could cushion state agencies in the next round of budget cuts in Annapolis but still leaves the state with projected shortfalls greater than $1 billion in coming years, state leaders said.

"It's progress, but the long-term problems aren't going to go away," said Senate President Thomas V. Mike Miller Jr. (D-Calvert). "It's an issue of a major sore versus a festering wound."

Even if the uptick in tax revenue portends a lasting improvement in the state's economy, Miller and others said, it would not fundamentally alter the debate over whether Maryland should close the gap between spending and revenue with budget cuts, tax increases or revenue from slot machine gambling.

Legislative analysts said much of Maryland's surplus could be attributed to surges in income and sales taxes before June 30, the close of the state's 2004 fiscal year. Revenue from those taxes tends to pick up when the economy improves.

In a letter to state officials, David F. Roose, director of the Bureau of Revenue Estimates, said Maryland's economy was "particularly strong" between February and June, a period of notable employment growth, rising home prices and stock market growth.

"While we do not expect this very strong growth to continue, the results of fiscal year 2004 do bode well for the future," Roose wrote.

In Virginia, Gov. Mark R. Warner (D) said this week that he would use an unexpected $324 million surplus to accelerate an income tax break for most families in the commonwealth.

In the District, Mayor Anthony A. Williams (D) urged rescinding some budget cuts after he learned this spring that tax collections were expected to yield $50 million more than projected. A revived tourism industry has helped drive the District's collections.

In Maryland, Gov. Robert L. Ehrlich Jr. (R) could use much of the 2004 surplus to plug part of a gaping hole in the 2006 budget that he is scheduled to present to the General Assembly in January, said Budget and Fiscal Planning Secretary Chip DiPaula Jr.

Projections released earlier this year forecast an $830 million deficit in the 2006 general fund budget of roughly $11 billion.

House Speaker Michael E. Busch (D-Anne Arundel) said the extra $300 million could reduce the pain of expected cuts in programs such as Medicaid, which provides health care for the poor, and in aid to local governments.

"This limits the amount of the cuts you have to make or the revenue you have to raise," Busch said. "Bottom line, it's good news that revenues are starting to rebound. . . . But you're still looking at a structural deficit that has to be addressed."

That point was underscored by Comptroller William Donald Schaefer (D), whose office released the year-end surplus figure yesterday morning. Schaefer noted that legislative analysts have projected a deficit of $1.4 billion for the 2007 fiscal year.

"Even if this surplus is sustainable -- and there's no guarantee it will be -- we are still short of where we need to be to balance future state budgets," Schaefer said in a statement.

For the long term, DiPaula said, the governor remains committed to continuing a "strategic budgeting" process under which state agencies are being asked to propose how they would operate with 88 percent of their current funds. To spend more, agencies will have to justify the need.

For the past two years, Ehrlich has also pushed the legalization of slot machine gambling as part of the solution to Maryland's long-term woes. His administration estimates that assessments on the machines could generate $800 million a year for the state.

Busch, meanwhile, advocated a $1 billion tax increase, packaged with reductions in property taxes, during the last legislative session. The House passed the bill, but the Senate killed it.