RICHMOND — At a time when struggling states are cutting budgets and sending pink slips to workers, Virginia has something else in store: bonuses for state employees.

Virginia finished its fiscal year June 30 with a $448.5 million surplus through a combination of higher-than-projected revenues and agency cost-cutting, putting the state far enough into the black to give a 3 percent bonus to state workers who have not had a pay raise in five years.

“Simply put: Over the past three years, we have brought in more revenue than forecasted, and spent less than budgeted,” said Gov. Robert F. McDonnell (R) said Wednesday. “That is responsible fiscal management. It is the Virginia way.”

McDonnell’s report to the General Assembly’s money committees set off a debate over whether taxes are too high or services too skimpy, prompting calls from the right to to cut taxes and from the left to raise them so the government could do more for its citizens.

“It’s only fair to taxpayers whom we have over-taxed. . . to make sure they are refunded the overcharge,” said Del. Ben L. Cline (R-Rockbridge), co-chairman of the Conservative Caucus, who has pushed for the elimination of corporate income taxes.

Sen. Richard L. Saslaw (D-Fairfax) , who said the surplus was partly due to budget gimmicks, called that idea “just absurd.”

“We could give it all back to them and not bother to fund public schools or higher ed,’’ he said. “Our problem is we don’t have enough revenue.”

McDonnell hailed the surplus as the fruit of prudent fiscal management, drawing a contrast with the debt-ridden federal government. But some attributed the surplus to federal defense spending, which kept the most populous parts of Virginia humming throughout the recession; deep cuts to schools and social services; and deferring $224 million in Virginia Retirement System contributions.

Virginia’s results put it ahead of many states. Revenue grew 5.4 percent in fiscal 2012 without the benefit of any tax increase, compared with an average of 2.9 percent nationally, said Arturo Perez, a fiscal analyst with the National Conference of State Legislatures in Denver.

Across the Potomac, a snapshot of state finances shows similarly good news for Maryland — revenues are up and expenses are in line with estimates, for an expected year-end surplus of about $520 million, or $200 million more than expected.

But the state’s economic model is different. Maryland Gov. Martin O’Malley (D) and the state legislature have during the downturn approved record spending increases for education, let entitlement costs soar, and, in turn, ratcheted up taxes on the wealthy as federal stimulus money has receded to help pay for the growing costs.

This year, O’Malley proposed and the legislature approved about $1.2 billion in higher spending, including hundreds of millions more for colleges and grade schools; a 2 percent pay raise for state employees; and more borrowing for infrastructure projects such as accelerated school construction. The state also cut 100 positions and was forced to set aside most of an $87 million general-fund increase to cover rising health and retirement costs for state employees.

Virginia and Maryland are better off than most states, in no small part because they have benefited from proximity to Washington and its expanding universe of federal contracting jobs.

The two are among eight states to have retained the nation’s highest credit rating through the downturn, but ratings agencies have said that each is now also among the states most susceptible to lost revenue and other ills should the federal government follow through with planned spending cuts next year.

Virginia’s strong fiscal position will allow state workers to get bonuses premised on a state surplus of about $80 million. All 100,000 state workers are eligible, but they must receive satisfactory job evaluations to get the one-time windfall. While they have not gotten pay raises in several years, they were last given a bonus in 2010.

The bonuses will consume about $77 million of the surplus, which will also be partly devoted to the state’s rainy-day fund ($78.3 million), higher education and non-general fund accounts ($132 million), a separate fund to hedge against pending federal cuts ($30 million) and transportation ($21 million).

While McDonnell celebrated Virginia’s bottom line, some questioned whether there was anything to cheer.

“It’s important to remember, in looking at this surplus, how we got here,” said Sara Okos, policy director at the Commonwealth Institute for Fiscal Analysis, which focuses on economic issues for low- to moderate-income Virginians. “In 10 of the last 12 years, we have closed those [shortfalls] primarily from cuts, accounting tricks and gimmicks.”

She pointed to the accelerated sales tax, which requires many businesses to make an extra sales tax payment. The policy predates McDonnell, who has opposed it and pushed to phase it out. But the results he trumpeted Wednesday were partly based on it.

“We’re starting to unwind that [accelerated sales tax], and we’re ahead of schedule,” she said. “But it’s not unwound yet. . . . The surplus on paper is a good thing, but I still think we haven't addressed pressing needs in the state — transportation, K-12.”

There was less dissension on a point McDonnell made in his presentation to the General Assembly’s money committees: The state’s finances could look far different if federal spending cuts known as sequestration take effect. The defense-heavy economy that has helped large swaths of Virginia ride out the recession with relative ease could take a huge hit if the federal cuts take effect.

That warning left some lawmakers with mixed feelings as they took in news of the surplus but considered where they could be a year or two from now.

“It’s better news than we’re used to,” said Sen. Charles J. Colgan (D-Prince William), who voted with Republicans on the budget this year. “But of course, he also let us know it could be pretty bleak with the Defense Department cuts.”