Wall Street surged on Wednesday as surging oil prices boosted energy stocks following US President Donald Trump's decision the previous day to quit a nuclear agreement with Iran.

Gains were broad and volume was high, with all but the utilities and telecom sectors advancing as investors who had moved to the sidelines in recent days ahead of Trump's decision returned to the market.

Trump's decision for the United States pull out of the international agreement aimed at preventing Iran from obtaining a nuclear weapon was good news for investors betting on a rise in oil prices. Crude hit its highest level in 3-1/2 years as investors bet the U.S. withdrawal would increase risks of conflict in the Middle East and curtail global oil supplies.

The S&P energy index jumped 2.03 percent, bringing its gain this quarter to 12.6 percent, more than any other sector.

"The rise in oil is helping energy sector, which is expected to be a pretty big growth sector. A lot of analysts are expecting strong earnings as oil rebounds, and that hasn't really played out so much early this year," said Shawn Cruz, senior trading specialist at TD Ameritrade in Chicago.

The Dow Jones Industrial Average rose 0.75 percent to end at 24,542.54 points, while the S&P 500 gained 0.97 percent to 2,697.79.

The Nasdaq Composite added 1 percent to finish the session at 7,339.91.

The Cboe Volatility Index , the most widely followed barometer of expected near-term volatility for the S&P 500, closed down 1.29 points at 13.42, its lowest close since Jan. 26.

Worries lingered that rising oil prices would perk up inflation. The US 10-year Treasury yield rose to a two-week high and above the key 3 percent level on expectations of higher interest rates.

With March-quarter reports mostly wrapped up, S&P 500 earnings per share appear to have surged by 25.9 percent, helped by deep corporate tax cuts introduced this year, according to Thomson Reuters I/B/E/S.

In stock trading, Google-owner Alphabet Inc rose 2.87 percent, providing more lift than any other stock to the S&P 500. It was followed by Facebook Inc , which rose 2.09 percent.