Gov. Robert F. McDonnell (R) said he expects Virginia’s surplus to increase by at least another $35 million to $40 million after the state calculates taxes for June, the final month of the fiscal year. (Steve Helber/AP)

Gov. Robert F. McDonnell announced Tuesday that Virginia finished its fiscal year with a surplus of $311 million — its second straight year with higher-than-expected revenue, even as other states continue to slash budgets.

McDonnell said he expects the surplus to increase by at least another $35 million to $40 million after the state calculates taxes for June, the final month of the fiscal year.

“A key to what we have done in Virginia is we decided to budget conservatively, cut spending dramatically and to not raise taxes,’’ McDonnell (R) said at a news conference on Capitol Square. “I think, to me, that is the formula for why Virginia — and states like Virginia — have experienced this kind of growth.”

The governor credited higher tax revenue — 5.8 percent growth in fiscal year 2011, instead of a forecast 3.5 percent — as the main reason for the surplus. It is the first year since 2008 that state revenue has increased over the previous year.

He proposed giving some of the unspent balance to sheriff’s offices across the state and to localities hit by recent tornadoes in southwest Virginia, as well as shoring up the pension system.

But Virginia law calls for the bulk of the money to be put into the state’s rainy day fund and spent on K-12 education, transportation and Chesapeake Bay cleanup.

McDonnell said he considered giving state employees a raise, but lawmakers had not approved salary increases during their legislative session this year.

The state is legally required to maintain a balanced budget, which means McDonnell and the General Assembly would have to impose budget cuts to achieve a surplus if projections indicated that tax revenue would be lower than predicted.

Democrats criticized McDonnell for declaring a surplus after years of cuts to core services; delayed payments to the Virginia Retirement System; and a requirement that retailers pay sales tax a month early, allowing the state to receive money in an earlier fiscal year.

“This is a surplus built on gimmicks, borrowing and shortchanging investments in Virginia’s future,” said Brian Moran, chairman of the Democratic Party of Virginia and a former legislator. “Bob McDonnell is building a Virginia in which state and local governments struggle to educate our kids, keep our communities safe, build and maintain infrastructure, and keep our promise to our retirees. We are falling behind other states, and that is nothing to celebrate.”

The General Assembly passed a $78 billion budget for fiscal 2011 and 2012 with no general tax increase, but the budget did include several fees and hundreds of millions of dollars in cuts, including to health care, schools and public safety, as it tried to close a $4 billion shortfall over the two years.

Retailers are required to pay sales tax to the state early for one month — allowing the state to collect the tax in June, during the previous fiscal year, instead of in July, during the next fiscal year. Businesses oppose the policy, and legislators are phasing out the practice.

The state, which is required to make payments each year to the Virginia Retirement System for public employees, reduced its payments by $620 million, promising to return the money with interest starting in 2013. It made an early payment of more than $20 million this year, Finance Secretary Richard D. Brown said.

“I think one of the first things we have to do is look at our VRS obligations,’’ said House Minority Leader M. Kirkland Cox (R-Colonial Heights). “I don’t think there’s any question on that.”

A year ago, Virginia ended the fiscal year with a surplus of about $403.2 million — $229 million came from taxes, and the rest from savings.

“While we can be pleased with the success we have enjoyed in getting the commonwealth’s financial house back in order, we will continue to face significant budget pressures in the years to come, most significantly the uncertain economic environment on a national basis,’’ said Lt. Gov. Bill Bolling (R), who serves as the state’s chief jobs-creation officer. “Therefore, we must continue to be frugal with how we spend the taxpayers’ money.”