A pump jack is seen at sunrise near Bakersfield, California October 14, 2014. REUTERS/Lucy Nicholson

By Richard Leong

NEW YORK (Reuters) - U.S. stock prices held firm on Thursday after the Dow and Standard & Poor's 500 reached record intraday highs, while crude fell below $80 a barrel for the first time in four years on further signs of a slowdown in China's economy.

Brent crude, which has fallen more than 30 percent since June, settled down $2.46 or 3.1 percent at $77.92 a barrel, while U.S. oil futures settled down $2.97 or 3.85 percent at $74.21.

Data from Beijing showed below-forecast factory output and investment growth at a near-13-year low, reinforcing signs that the world's second-biggest economy would have its weakest growth in almost 24 years this year.

"Energy prices continue to be a headwind," said Art Hogan, chief market strategist at Wunderlich Securities in New York.

Falling energy costs, while a positive for consumers, have raised concerns about profits of major oil companies and their capital spending, analysts said.

Encouraging sales results from Wal-Mart, the world's largest retailer, offset weakness in the energy sector on Wall Street along with concerns that the market is overstretched.

The Dow Jones industrial average closed up 40.59 points, or 0.23 percent, to 17,652.79, the S&P 500 ended up 1.08 points, or 0.05 percent, to 2,039.33 and the Nasdaq Composite finished 5.01 points, or 0.11 percent higher, at 4,680.14.

Top European shares closed up 0.2 percent at 1,346.56, reversing an earlier decline driven by a 1.7 percent drop in an index of regional oil and gas shares.

Earlier, Tokyo's Nikkei index raced to fresh seven-year highs after Jiji news agency reported Prime Minister Shinzo Abe appears to have decided to call an early election amid mounting expectations he would postpone a planned sales tax hike.

Speculation about a snap election in Japan pulled the yen toward a recent seven-year low against the dollar before the greenback briefly retreated on a bigger-than-expected rise in weekly U.S. jobless claims. The dollar was last up 0.2 percent at 115.77 yen.

The dollar was mixed against other major currencies. The euro gained 0.3 percent at $1.2477, while sterling hit a 14-month low at $1.5694. [FRX/]

The yield on benchmark U.S. 10-year Treasuries slipped 1.5 basis points to 2.35 percent.

Safe-haven gold rose 0.08 percent to $1,161.18 an ounce, holding above Friday's 4-1/2-year low of $1,131.85.





(Additional reporting by Rodrigo Campos, Chuck Mikolajczak in New York, Marc Jones in London,; Blaise Robinson in Paris and; Jacob Gronholt-Pedersen in Singapore; Editing by James Dalgleish)