NEW YORK, April 8 (Reuters) - U.S. stocks surged on Wednesday after a last-minute, two-week ceasefire agreement between the United States and Iran lifted investor sentiment.

All three major U.S. stock indexes burst out of the starting gate with sharp gains under the power of a broad relief rally after a deal brokered by Pakistan resulted in a two-week suspension of the war. The conflict, which began with joint U.S.-Israeli strikes on Iran on February 28, has sent world markets reeling, disrupted global oil supply and sparked fears of rising inflation.

A senior Iranian official told Reuters that the crucial Strait of Hormuz, through which one-fifth of the world's oil is shipped, could be reopened on Thursday or Friday ahead of peace talks if the countries agreed upon a framework for the ceasefire.

"It's kind of a one-note day," said Ross Mayfield, investment strategy analyst at Baird in Louisville, Kentucky. "This big, risk-on rally is exactly what you would expect, when over the last six weeks, sentiment got washed out."

"So when you have a catalyst there's more room to the upside," Mayfield added. "The market has been setting itself up for something like this for weeks now."

The S&P 500 shot above its 200-day moving average for the first time since mid-March, while the Dow was gearing up for its largest single-session gain since last May.

Economically sensitive Dow Transports touched an all-time high, while the Russell 2000 outperformed its larger-cap peers.

The rally was not confined to U.S. indexes. European shares rose 3.9%, their biggest one-day percentage gain in a year. MSCI's World index was up 3.3%.

"Most other countries were more exposed to an energy shock and a food shock than the U.S.," Mayfield said. "So this is a much bigger near-term relief for international stocks."

The CBOE Market Volatility index, a barometer of investor anxiety, dipped to its lowest level since the beginning of the war.

Front-month WTI and Brent crude futures slid 13.0% and 17.0%, respectively, dropping below $100 per barrel.

Minutes from the U.S. Federal Reserve's March meeting, released on Wednesday, showed a growing openness to rate hikes as policymakers raised their 2026 inflation outlook due to war-related oil shock.

The Dow Jones Industrial Average rose 1,311.67 points, or 2.82%, to 47,896.13, the S&P 500 gained 170.52 points, or 2.58%, to 6,787.48 and the Nasdaq Composite gained 670.59 points, or 3.05%, to 22,688.24.

Of the 11 major sectors in the S&P 500, nine were enjoying gains of 1% or more, with industrials leading the pack. Energy stocks, dragged down by falling crude prices, were the sole percentage losers, falling 4.8%.

Sectors that have suffered a beating since the war began enjoyed a robust bounce-back. Commercial airlines jumped 7.6%, travel and leisure-related stocks shot up 6.2% and homebuilders rose 5.6%.

Delta Air Lines gained 6.0%, despite its disappointing second-quarter profit forecast. The commercial air carrier declined to update its annual outlook due to uncertainties related to the Iran war.

Delta peers Southwest Airlines and United Airlines advanced 7.3% and 10.1%, respectively.

Cruise operators Carnival added 11.6% and Norwegian Cruise Line rose by 9.4%.

Levi Strauss jumped 12.1% after the apparel maker raised its annual sales and profit forecasts.

Advancing issues outnumbered decliners by a 5.73-to-1 ratio on the NYSE. There were 164 new highs and 30 new lows on the NYSE.

On the Nasdaq, 3,717 stocks rose and 985 fell as advancing issues outnumbered decliners by a 3.79-to-1 ratio.

The S&P 500 posted 19 new 52-week highs and no new lows while the Nasdaq Composite recorded 126 new highs and 39 new lows.

(Reporting by Stephen Culp in New York; Additional reporting by Johann M Cherian, Purvi Agarwal and Avinash P in Bengaluru; Editing by Matthew Lewis)

By Stephen Culp and Purvi Agarwal