Oil rose for a third day, the longest winning streak in a month, as slowing growth in China fueled stimulus speculation and U.S. equities advanced.
Crude gained 1.2% as China's growth declined to the weakest pace in three years, putting pressure on the government to act. U.S. stocks rose, with the Standard & Poor's 500 Index gaining for the first time in seven days.
"Increasingly there is a feel that we'll see some stimulus plans from places like China and you'll see stronger economic growth in the second half and stronger oil demand," said Michael Lynch, president of Strategic Energy & Economic Research in Winchester, Massachusetts. "We are back on a bullish trend along with equities."
Crude for August delivery added $1.02 to settle at $87.10 a barrel on the New York Mercantile Exchange, capping a weekly gain of 3.1%. Prices are down 12% this year.
Brent oil for August settlement gained $1.33, or 1.3%, to $102.40 a barrel on the London-based ICE Futures Europe exchange.
China's economic expansion slowed for a sixth quarter, growing at 7.6 percent in the second quarter, data from the National Bureau of Statistics showed today. That compares with an 8.1% gain in the previous period and the 7.7% median forecast of economists. Industrial production increased at a slower pace in June while retail sales growth decelerated.
The People's Bank of China on July 5 announced the second interest-rate cut in a month, adding to the first since 2008. Premier Wen Jiabao pledged to intensify fine-tuning of policies, according to a July 8 report by the official Xinhua News Agency.
China is the world's second-biggest oil consumer after the U.S., using 9.76 million barrels a day in 2011, according to BP Statistical Review of World Energy.
U.S. stocks rallied as JPMorgan Chase & Co. surged after reporting earnings. The S&P 500 gained as much as 1.7%. The S&P's GSCI Index of 24 commodities increased 1.2%.
Oil also advanced as the U.S. announced more sanctions on Iran. Yesterday the Obama administration sanctioned the National Iranian Tanker Co. and four alleged front companies for Iran's oil trade, the latest salvo in a U.S.-led campaign to curtail Iran's petroleum sales until it abandons illicit aspects of its disputed nuclear program.
The U.S. Treasury Department announced it would freeze American assets belonging to the tanker operator, known as NITC, and block the company's transactions from the U.S. financial system. The Treasury identified 27 entities affiliated with the tanker company and 58 vessels -- some of which have been reflagged in other countries to evade international sanctions on Iran's petroleum sales.
"The U.S. is tightening sanctions with Iran, and that is the whole basis for this rally," said Phil Streible, a Chicago- based commodities broker at RJO Futures.
Oil also gained as the euro strengthened against the dollar as Italian borrowing costs fell at an auction. The euro rose as much as 0.4 percent to $1.2257. A stronger euro and weaker dollar boost oil's appeal as an investment alternative.