The price of oil surrendered some of its recent gains Friday, falling back to near $104 a barrel, as concerns over China's decision to press ahead with painful economic restructuring offset upbeat U.S. economic news.

By early afternoon in Europe, benchmark crude for September delivery was down $1.19 to $104.30 a barrel in electronic trading on the New York Mercantile Exchange. The contract rose 10 cents to $105.49 on Thursday.

The Nymex contract broke above $100 on July 3 for the first time since May 2012 and peaked at slightly above $109 on July 19, pushed higher mostly by falling U.S. crude stockpiles and increased interest from financial investors.

On Friday, it was weighed down by signs that China, a major energy consumer, is reluctant to splash out on another round of economic stimulus. The government ordered companies in 19 industries from steel to glass to close some factories to reduce overproduction that has led to price-cutting wars.

The impact of the news offset U.S. figures showing orders for long-lasting factory goods rose in June. The increase suggests companies are more confident in the economy and could boost economic growth and demand for crude in the second half of the year.

"Oil prices are finding themselves unable to profit from the weaker U.S. dollar, the good economic data in the U.S. and Europe or from the ongoing supply risks," said a report from analysts at Commerzbank in Frankfurt. They noted prices are still being weighed down by reports in recent weeks showing U.S. oil production is rising to its highest level since 1990.

Elsewhere, Brent crude, which is traded on the ICE Futures exchange in London, was down 13 cents at $107.52 a barrel.

In other trading on the Nymex:

— Wholesale gasoline rose 0.7 cent to $2.993 a gallon.

— Heating oil fell 0.6 cent to $3.034 a gallon.

— Natural gas shed 1.1 cents to $3.633 per 1,000 cubic feet.