US oil settles down 28 cents, at $36.76 a barrel

Oil prices slid on Monday in volatile trade that saw an early rally of more than 4 percent on tensions in the Middle East until those gains were erased on worries about a slowing global economic growth and sliding stock markets.

Data showing an inventory build at the Cushing, Okla. delivery hub for U.S. crude futures also weighed on sentiment, traders said.

Brent, the global oil benchmark, fell 5 cents, or 0.13 percent, at $37.24 a barrel, having hit an intraday high of $38.99.

U.S. crude's West Texas Intermediate (WTI) futures settled 28 cents lower, or 0.76 percent at $36.76 a barrel.

WTI was also weakened by data from market intelligence firm Genscape that showed a build in Cushing supply, traders who saw the data said.

OPEC as we know it is over: John Kilduff

Global equity markets fell after a 7 percent slide in Chinese shares, sparked by weak economic data, rekindled worries about global growth. U.S. stock indexes lost more than 2 percent, with the Dow sliding more than 400 points.

Earlier in the session, oil had rallied after a breakdown in diplomatic ties between Saudi Arabia and Iran that some analysts speculated could result in supply restrictions on crude shipments out of the Middle East.

"The Saudi-Iran standoff is certainly one to worry over given its ramifications for oil supply," said Phil Flynn, analyst at the Price Futures Group brokerage in Chicago.

"But the equity markets selloff is more pressing and difficult to ignore because of the impact of China on the global economy and overall demand for oil."

Surveys in China showed factory activity in the world's second-largest economy shrank sharply in December, sparking a 7 percent slide in Chinese shares that triggered a trading halt.

The clash between Saudi Arabia and Iran comes as Tehran, which holds some of the largest proven reserves, hopes to ramp up oil exports following the expected removal of sanctions against it under a deal over Iran's contested nuclear program.

Iran plans to raise output by half a million to 1 million barrels per day (bpd) after sanctions are lifted.

Energy Aspects analyst Richard Mallinson said the market is grappling with the question of "where next in the Saudi Arabia/Iran stand-off? I think President (Hassan) Rouhani on the Iranian side would like to calm things down and push for no further escalation."