oil house down 2

Falling oil prices might be good for your gas tank, but for your home’s value … maybe not so much.

Home prices are expected to rise around 3.5% this year, but some energy-producing states could be facing smaller gains or even an eventual decline.

Falling energy prices are good news and bad news for housing markets. On one hand, lower energy prices keep more money in people’s pockets and increase spending power. But for states with economies tied to the energy sector, lower oil, gas and coal prices can bring layoffs, belt-tightening and less demand for housing.

“Fewer jobs means less home buying demand and that will naturally soften the housing markets in those job-impacted areas,” said Lawrence Yun, chief economist at the National Association of Realtors.

Tight inventory has been plaguing many markets and propping up prices. But if demand slows and supply catches up, price increases might finally slow down … or even stop.

Related: 3 reasons oil prices are plunging again

North Dakota is the most at risk for falling home prices, according to experts. The state’s most recent oil rush led to a housing boom as people poured in looking for jobs. But now, as oil prices sit near 12-year lows, the boom could be fading along with job opportunities.

“The jobs are leaving, and if an area gets depopulated, they can’t take the houses with them and that’s dangerous for the housing market,” said Ralph DeFranco, senior director of risk analytics and pricing at Arch Mortgage Insurance Company.

Now, home prices in North Dakota are 20% overvalued, according to a report from Arch MI, with a 46% chance they’ll decline in the next two years. While that means there’s less than a 50% chance of a decline, the outlook could worsen if energy prices and employment weaken.

The company also identified Wyoming, West Virginia and Alaska as facing the biggest risks of falling home prices.

Lower natural gas prices have put pressure on coal prices, which puts Wyoming and West Virginia’s housing markets at risk for a pullback as employment dips.

Yun is also keeping an eye on home prices in Oklahoma and Louisiana, which took a hit back in the oil glut of the mid 1980s.

While the top five places on Arch MI’s list of the largest cities with the highest risk of falling home prices are in Texas, including Houston and Austin, experts said the state’s economy is diversified enough to help soften the blow.

Related: The 10 hottest housing markets for 2016

Tight inventory has been a leading cause of rising home prices nationwide, the lack of supply could keep home prices from falling too much too fast if energy prices continue to drop.

“Because we are starting out in a housing shortage … it could move to a more balanced market,” Yun said.

While there is a link between energy and housing prices, it’s not an immediate one, according to JP Ackerman, president, strategic real estate products at HouseCanary. It usually takes about 15-24 months after the start of an extended decline in the oil market, he said, for a housing market to react.

That means the housing market could start feeling the brunt of oil’s recent drop toward the end of this year, he said.

“The current health of the markets across Texas and other oil-rich markets is likely still driven by high oil prices prior to the sharp declines.”

And some states get a boost from falling energy prices, like those in the Great Lakes region.

“When oil prices go down, it stimulates the demand for automobiles and jobs and it does ultimately stimulate home values,” said Ackerman. “When oil was over $100 a barrel that really affected Detroit.”