(Reuters) -World stock markets fell on Friday, and oil prices surged, as Israel launched military strikes on Iran, sparking inflows into safe havens such as gold and the dollar.  

Early on Friday, U.S. President Donald Trump urged Iran to make a deal over its nuclear program - the primary target of the strikes - saying there was still time for the country to prevent further conflict with Israel. But later in the day, Iran fired missiles at Israel in response to the attacks; explosions were heard over Tel Aviv and Jerusalem as sirens sounded on Friday night across the country.

 Worries that the conflict could disrupt Middle Eastern oil and gas supplies pu shed prices sharply higher . Global benchmark Brent crude futures settled 7% higher at $74.23 a barrel, after earlier soaring over 13%, while U.S. crude finished at $72.98 a barrel, up 7.62%. U.S. natural gas climbed about 3% and European gas prices jumped over 5% to their highest intraday level in 10 weeks.

Gold, a safe haven in times of global uncertainty, rose 1.4% to $3,431 per ounce, bringing it close to the record high of $3,500.05 from April.

The rush to safety was matched by a dash out of risk assets. The Dow Jones Industrial Average fell 1.8%, the S&P 500 dropped 1.1%, and the Nasdaq Composite lost 1.3%. European shares dropped 0.9%, briefly hitting its lowest level in three weeks, and in Asia, major bourses in Japan, South Korea, and Hong Kong fell over 1% each.

An escalation in the Middle East - a major oil-producing region - adds uncertainty to financial markets at a time of heightened pressure on the global economy from President Trump's unpredictable trade policies.

"The re-emergence of major conflict in the Middle East should raise geopolitical stress, including sharply higher oil prices," Sameer Samana, head of global equities and real assets at Wells Fargo Investment Institute, said in an email. Samana added, though, that the conflict should represent a buying opportunity for long-term investors, including in U.S. large-cap stocks and commodities.

Investors will also keep close watch on planned protests across U.S. cities on Saturday, amid heightened concerns following immigration raids in Los Angeles.

TWO-WAY PULL FOR BONDS

U.S. 10-year Treasury yields rose 5.6 basis points to 4.413%, as markets absorbed a sudden shock to commodity and stock prices, reversing some of the declines after four days mainly in the red. 

"This is a flight-to-safety event. But markets are struggling a bit, and in the fixed income space you have an oil-price shock that is inflationary, and so you should see markets expecting an even more hawkish Fed," said James Rossiter, head of global macro strategy at TD Securities.

"On the other hand, you have the flight to safety, which should push bond yields lower."

Some traders were attracted to the dollar as a haven, with the dollar index up about 0.5% to 98.16, retracing most of Thursday's sizeable decline.

The Swiss franc briefly touched its strongest level against the dollar since April 21, before trading 0.1% lower at around 0.811 per dollar.

Another safe haven, the Japanese yen, fell 0.34% to about 144 per dollar, giving up earlier gains of 0.3%.

The euro was down 0.3% at $1.15, after rising on Thursday to the highest since October 2021.

"Clearly if the conflict in the Middle East is short term in nature, the weakness in USD will likely continue," Arun Bharath, Chief Investment Officer at Bel Air Investment Advisors, said in an email. If not, he added, the fundamental factors that suggest further weakness for the dollar might be offset by a geopolitical premium for it.

(Reporting by Lawrence Delevingne in Boston and Dhara Ranasinghe in London; additional reporting by Kevin Buckland in Tokyo; Editing by Toby Chopra, Rod Nickel, Sandra Maler and Marguerita Choy)

By Lawrence Delevingne and Dhara Ranasinghe