The S&P 500 flirted with a landmark new peak Thursday, but finished just shy of 5,000 points, while oil prices shot higher on worries about the Middle East.

US indices eked out modest gains following another round of solid earnings from Disney and others.

But while the broad-based S&P 500 actually edged up to 5,000.40 in the final moments of trading, it finished at 4,997.91 -- up 0.1 percent but short of its first ever close above 5,000 points.

Angelo Kourkafas of Edward Jones said next week's consumer price index report could be the catalyst that lifts the S&P 500 above the 5,000-point threshold.

"It's just a number but it's symbolic of the strength that we have seen in equities given what else is going on," Kourkafas said. "Nothing points to the trend being over."

Still, said in a note that more investors are eyeing a pullback that has yet to occur.

"Everyone is waiting for a break in the action, but clearly there are enough participants who have kept playing the momentum trade and are intent to stay with the trend until it is no longer a friend."

European stock indices were mostly higher, playing catch-up with Wall Street. Paris, Frankfurt and Milan rose, while London was down.

"Sentiment remains positive as investors take encouragement to the fresh record highs being hit across Wall Street on an almost daily basis," said David Morrison, senior market analyst at Trade Nation.

Among individual companies, Disney rocketed up 11.5 percent as the entertainment giant reported better-than-expected profits, disclosed it is buying a stake in Fortnite maker Epic Games and announced a dividend hike and new share repurchase program.

Shares in French luxury giant Kering rose six percent despite a drop in annual sales and profit as the company refocuses its business around its top brand Gucci.

London's FTSE 100 index was pulled lower by British drugs group AstraZeneca, which slid six percent on concern over its outlook after posting bumper profits last year.

Danish shipping giant Maersk's stock price tanked by 15 percent in Copenhagen after it logged a massive drop in net profit last year and warned that unrest in the Red Sea clouded its 2024 outlook.

Oil prices jumped more than three percent on a mix of Middle East tensions and declining US stocks of gasoline and distillate products. However, analysts said concerns about demand in China could keep a cap on prices.

- Key figures around 2130 GMT -

New York - Dow: UP 0.1 percent at 38,726.33 (close)

New York - S&P 500: UP 0.1 percent at 4,997.91 (close)

New York - Nasdaq: UP 0.2 percent at 15,793.72 (close)

London - FTSE 100: DOWN 0.4 percent at 7,595.48 (close)

Paris - CAC 40: UP 0.7 percent at 7,665.63 (close)

Frankfurt - DAX: UP 0.3 percent at 16,963.83 (close)

EURO STOXX 50: UP 0.7 percent at 4,710.78 (close)

Tokyo - Nikkei 225: UP 2.1 percent at 36,863.28 (close)

Hong Kong - Hang Seng Index: DOWN 1.3 percent at 15,878.07 (close)

Shanghai - Composite: UP 1.3 percent at 2,865.90 (close)

Dollar/yen: UP at 149.30 yen from 148.18 yen on Wednesday

Euro/dollar: UP at $1.0781 from $1.0772

Pound/dollar: DOWN at $1.2620 from $1.2626

Euro/pound: UP at 85.40 pence from 85.31 pence

Brent North Sea Crude: UP 3.1 percent at $81.63 per barrel

West Texas Intermediate: UP 3.2 percent at $76.22 per barrel