(CNBC) -- Stocks rose on Wednesday as energy shares jumped on the back of a strong rally in oil prices. The move higher follows President Donald Trump's decision to pull the U.S. out of the Iran nuclear deal.
The S&P 500 closed 0.9 percent higher, with energy rising 2 percent. Occidental Petroleum was one of the best-performing stocks in the S&P 500, rising 5.4 percent.
Technology shares also boosted the broad index, rising 1.4 percent, while industrials, financials and materials also jumped.
Advertisement - story continues below