The trading pattern of the prices of stocks and crude oil looks worryingly like it did just before the last recession.

Oil and equity prices rise and fall more or less in tandem when demand and economic growth expectations dictate prices. But the short-term relationship has been turned on its head in recent weeks with investors worried that political unrest in oil exporting countries could hit oil supplies and hurt the U.S. economic recovery.

Brent crude, the European benchmark, and the U.S. S&P 500 stock index <.SPX> have not moved against each other in such a way since mid-2008, when oil spiked dramatically, the economy entered its worst recession since the 1930s, and stocks went into a tailspin. Once again in early 2011, oil prices are rising, and stocks have taken a hit.

Their 20-day correlation coefficient stands at -0.68, the lowest since August 2008. A perfect inverse correlation would score -1. Prior to this move, that correlation had only flipped negative on 18 days in the last two years.

The price of oil is not based on fundamentals but headline risk, said Quincy Krosby, market strategist at Prudential Financial in Newark, New Jersey.

As long as it is risk that is pushing prices, the (stock) market will keep one eye open on how fast oil's moving up.

If the current oil price shock persists, the U.S. economy could grow at a far slower rate than anticipated or even see a contraction as consumers and businesses are saddled with higher costs for energy and fuel.

Paying $3.70 for a gallon of gas may be too much for consumers to bear, said Marshall Gause, founder of Geneva Fund Partners in Denver, Colorado. They have to buy (gasoline) and delay the purchase of more disposable goods.

The current U.S. average price for a gallon of gasoline is $3.542, up from $3.115 a month ago, according to AAA's daily report on fuel prices.

Oil and stock prices generally trade together because both are proxies for consumer demand and economic strength.

But current price hikes are driven mainly on supply worries, as rebellions have toppled the governments of Tunisia and Egypt while Libya edges toward civil war.

Reports of police firing at protesters on Thursday in Saudi Arabia, the world's largest oil exporter, have only added to investor uncertainty.

Moves like this can feed on themselves as traders use algorithms to set parameters for trades.

As long as the inverse relationship remains relatively strong due to somewhat predictable factors -- in this case, the unpredictable global situation and the attendant high oil prices -- the activity will continue.

Until resolution is achieved, oil is going to be a headwind to stocks.

However, the long-term correlation between equities and oil continues to be strong at 0.94, though it has fallen from near-perfect levels reached last month. A perfect correlation would see a 1.0 score. In the run up to the most recent recession in 2008, the long term correlation held positive. But months into the recession even the long-term correlation was inversed.

Short term, the action mirrors the period when crude oil prices hit the record high in 2008, spurred in part by threats to supplies from Iran and Nigeria. During that period, stocks and oil went separate ways as the oil spike helped deepen the 2007-2009 U.S. recession.

Meanwhile, many investors are betting that the oil price shocks will be temporary. Some are betting on energy shares as a defensive move and shunning other equities.

I'm in cash, overweight energy and into consumer staples, said David Kotok, chairman and chief investment officer at Cumberland Advisors in Sarasota, Florida, saying the US economy is vulnerable, and so are some others.

But if energy demand slows, energy shares may turn out to be an unsafe hiding place.

(Reporting by Rodrigo Campos; additional reporting by David Gaffen)