|Traders work on the floor of the New York Stock Exchange. (Spencer Platt/Getty Images/AFP)|
Both the S&P 500 and Nasdaq jumped to fresh all-time highs, with the S&P 500 ending up 11.42 points (0.48 per cent) at 2,402.32, and the Nasdaq gaining 28,44 points (0.46 per cent) at 6,149.67.
The Dow Jones Industrial Average rose 85.33 points (0.41 per cent) to 20,981.94.
Oil prices rallied after Russia's energy ministry released a joint statement with Saudi Arabia calling for a continuation of a deal to restrain production ahead of an OPEC meeting on May 25.
That gave a boost to energy shares, including oil giant Chevron, up 0.8 per cent, the midsized producer Marathon Oil, up 1.8 per cent, and oil-services giant Halliburton, up 3.0 per cent.
"We are seeing finally some rebound in the oil prices and that is definitely helping the energy sector," said Nicholas Colas, chief market strategist at Convergex, a brokerage firm.
"There has been a lot of worry about energy and how oil prices do not seem to have found a bottom, but this news from Saudi Arabia and Russia that seems to be helping."
Cybersecurity companies advanced after a cyberattack that started last week hit hundreds of thousands of computers worldwide. FireEye surged 7.5 per cent, Palo Alto Networks 2.7 per cent and Symantec 3.2 per cent.
Dow member Johnson & Johnson won 2.7 per cent following an upgrade from J.P. Morgan, which projected stronger growth in J&J's pharma business due to expected new product approvals.
Patheon, which provides outsourcing services to pharmaceutical companies developing new drugs, shot up 33.1 per cent after agreeing to be acquired by Thermo Fischer Scientific for US$7.2 billion. Thermo Fisher rose 0.4 per cent.