But with the recent slide in energy prices, fuel-rich states like Wyoming and Alaska are now facing the same sort of budget crises that had hit the rest of the nation.

Commodity prices have plunged over the past two years. That’s forced some energy states to dip into their “rainy-day funds.” And state officials say they’re worried that they don’t know when the rain’s going to stop.

Several energy-producing states were counting on oil prices to hold steady at $50 to $60 a barrel or more this year when they mapped out their budgets this year. Their plans are crumbling now that crude prices are barely breaking $40. Natural gas prices also are down sharply and the future for coal looks bleak.

“There’s no question about it, we’re going to face a serious shortfall,” Wyoming Gov. Matt Mead said this week when he rolled out his budget proposal for the coming two years.

In Wyoming, the nation’s leading coal-producing state, state fiscal analysts recently warned that revenues from federal coal leases are likely to fall from nearly $740 million in the two-year funding cycle that covered 2013-14 down to just $26 million in 2019-2020. The state has relied heavily on federal bonus payments to fund its schools.

Mead is proposing to reduce the amount of state mineral revenues that goes into permanent savings to free up money to fund programs.

Arturo Perez, fiscal analyst with the National Conference of State Legislatures in Denver, said the global oil glut is having an impact across the world.

“It’s safe to say that energy-producing states are weathering some issues with regard to revenue collections,” Perez said.

Nationwide, the amount that states and Native American tribes receive from energy production on federal lands has dropped 30 percent from fiscal year 2013 to fiscal year 2015, from $14.2 billion to $9.9 billion.

The problem may be most dramatic in Alaska, which long has relied on oil revenues to help fund state government. Alaska now faces an estimated budget gap of about $3.5 billion, even after a round of furloughs, eliminating positions and other austerity measures.

Alaska hasn’t ruled out the prospect of additional cuts or even new taxes – a shocking notion in a deeply conservative state proud of its lack of an income tax.

Lawmakers in Oklahoma also recently raided that state’s constitutional Rainy Day Fund for about $150 million to help close a $611 million hole in the budget for the current fiscal year.

The Oklahoma fund will probably be tapped again with the state expecting another $1 billion hole in the upcoming fiscal year. State finance officials say much of the shortfall is the result of the plunging price of oil and natural gas and its impact on Oklahoma’s economy.

In New Mexico, projections released in August estimated that revenues from oil and gas were expected to be more than 16 percent less than the previous fiscal year.

Legislative Finance Committee Chair Sen. John Arthur Smith said last month that New Mexico had been through tough times before but managed to pull through thanks to healthy reserves and conservative predictions.

“We thought we weathered the storm, but we might be headed directly into another storm and that’s a little bothersome,” Smith said.

In North Dakota, where an oil boom has transformed the state, depressed crude prices and a drop in drilling are depressing tax collections. Overall revenues are 7.5 percent lower than were expected for the two-year budget cycle that began July 1.

Associated Press reporters Susan Montoya Bryan in Albuquerque, New Mexico; Becky Bohrer in Juneau, Alaska; Matt Brown in Billings, Montana; James MacPherson in Bismarck, North Dakota; Sean Murphy in Oklahoma City and Will Weissert in Austin, Texas, contributed to this report.