Virginia Gov. Ralph Northam (D) speaks on Nov. 13 after the announcement that Crystal City has been selected as home to Amazon's new headquarters. (Kevin Lamarque/Reuters)

Go ahead and pop the cork, Virginia. The state’s economy has finally emerged from the shadow of the 2008 Great Recession, according to a new study from economists at Old Dominion University in Norfolk.

But don’t get too carried away. If Virginia doesn’t become less reliant on federal government spending, today’s good times might be a setup for another fall.

“Overall 2018 is shaping up to be the best year this decade for Virginia,” said Bob McNab, director of ODU’s Dragas Center for Economic Analysis and Policy and lead author of the annual State of the Commonwealth Report. “But while the day seems to be sunny, economically speaking, we’re looking at the horizon and seeing storm clouds, and most of those storm clouds seem to be associated with the federal government.”

Virginia’s gross domestic product, a measure of all goods and services, has grown for five consecutive quarters since March 2017, the ODU report found. That’s a surge of strength for an economy that had been stubbornly anemic. Once a powerhouse state, Virginia lagged the nation as a whole in economic growth for six years in a row, with some quarters tumbling into contraction.

A big reason the state took so long to recover from the recession is that government spending was slow to ramp back up. Sequestration — the trick Congress used in 2013 to impose automatic government spending cuts — has hamstrung Virginia’s economy ever since.

Virginia is one of the five most-government-dependent states in the country, with the Pentagon, military installations, contractors and federal workers making up about 30 percent of its economic activity.

Congress and the Trump administration have been boosting federal and defense spending, though, leading directly to Virginia’s rebound. Total federal awards — contracts awarded to companies or individuals — have risen to $102 billion so far this fiscal year from $88.3 billion in fiscal 2016, the ODU report found.

That’s great for the short term, but the report cautions that mounting federal deficits of more than $1 trillion per year are unsustainable and will inevitably lead to another round of cuts.

Posturing over shutting down the government and the debt ceiling don’t help, either. And federal debt leaves the government less able to respond with stimulus spending when another recession rolls around, McNab said.

“Our perspective is that we are closer to the next recession than farther away from it,” he said.

A few bright spots can point the state in the right direction. The ODU report is bullish on Virginia’s deal to woo Amazon’s second headquarters to Northern Virginia, which could bring 25,000 new, high-paying jobs for about $500 million in state inducements.

(Amazon founder and CEO Jeffrey P. Bezos owns The Washington Post.)

Indirectly, the Amazon facility could spur a total of 40,000 to 60,000 jobs, the report said, echoing a similar study released last week by the Virginia Chamber Foundation. Although it will also boost real estate prices and aggravate transportation problems, the development will be a significant contribution to diversifying the state’s economy, the report said.

That trend has already begun. Years of stagnant government spending prodded Virginia’s labor force toward private-sector growth. Last year, the report found, professional and business services jobs accounted for a larger portion of employment, at 18.1 percent, than public-sector jobs and government-related enterprises, at 16.9 percent.

“Where we’ve seen robust economic growth this business cycle has been in the private sector,” McNab said. “Anything that attracts entrepreneurial activity is good.”

Another factor that could boost the state’s economy is the decision earlier this year to expand access to Medicaid to about 400,000 more low-income Virginians. The ODU report estimates that fewer than 200,000 currently uninsured residents will enroll in expanded Medicaid, but says that extending coverage will help both recipients and health-care facilities.

“One of the unheralded benefits of Medicaid expansion is it allows people to earn a significant amount more than they can currently” and still be eligible, McNab said. “They can build more income, it builds a work ethic, creation of family wealth.”

And for providers, expanded Medicaid could reduce annual expenditures on uncompensated care by as much as $135 million per year, the report said.

But Medicaid expansion comes with two big caveats: About 500,000 Virginians will continue to lack health care, the report said. And the whole expansion is contingent on the federal government picking up 90 percent of the cost. The report is skeptical about Washington’s ability to continue shouldering that load as deficits soar.

Cutting back the federal reimbursement to even 50 percent, the report said, could boost Virginia’s cost by about $500 million.

Finally, another major problem facing the state is that the economic recovery is drastically uneven. While urban areas such as Hampton Roads, Richmond and Northern Virginia thrive, and even smaller metro areas such as Charlottesville and Roanoke have been surging, rural parts of the state continue to suffer. In the coal counties of far Southwest Virginia, between half and two-thirds of the workforce has given up on trying to find a job.

The report urges the state to work to spread the prosperity, investing in infrastructure, rural broadband and school improvements.

“Now is not the time to rest on our laurels,” the report says. “One hill has been climbed and now new hills await.”