Wall Street rose robustly for a second straight session on Wednesday, helped by higher oil prices and investors becoming more comfortable with the prospect of an interest rate hike as early as next month.

Combining Tuesday and Wednesday's performances, the S&P 500 gained 2 percent, its strongest two-day run since early March.

The energy sectorled the way in the latest session, up 1.51 percent as oil prices rose toward $50 a barrel. That followed a report of a larger-than-expected drop in U.S. crude inventories, adding to expectations that a steep sell-off in the commodity may be over.

Comments from policymakers in recent days and upbeat U.S. economic data have raised expectations that the Federal Reserve could pull the trigger on a rate increase much sooner than previously thought.

Traders are now pricing in a 38-percent chance for a rate hike in June and 45 percent in July, according to CME Group's FedWatch tool.

The S&P financial index rose 1.03 percent and ended the session at its highest point this year. Standing to benefit from higher interest rates that they can pass on to borrowers, Bank of America, JPMorgan and Citigroup rose over 1.5 percent.

"What you're seeing is a recognition that this is going to happen and investors are getting more comfortable with it," said Kurt Brunner, a portfolio manager at Swarthmore Group in Philadelphia. "There's a recognition that economic growth is okay."

Uncertainty around the United Kingdom's June referendum on whether to leave the European Union, as well as November's U.S. presidential election, could limit stock gains in the next few months, Brunner said.

The Dow Jones Industrial Average added 0.82 percent to end at 17,851.51 points and the S&P 500 gained 0.7 percent to 2,090.54.

The Nasdaq Composite climbed 0.7 percent to 4,894.89.

Gains were broad-based, with nine of the 10 major S&P sectors trading higher.

The S&P 500 has risen about 15 percent from its February lows and is up about 2 percent for the year.

Shares of Computer Sciences soared 42 percent after Hewlett Packard Enterprise said it would spin off and merge its struggling IT services business with the company. Hewlett Packard Enterprise jumped 6.77 percent.

Alibaba Group tumbled 6.82 percent after saying it was being investigated by the U.S. Securities and Exchange Commission over whether its accounting practices violated any federal laws.

About 6.9 billion shares changed hands on U.S. exchanges, below the 7.3 billion daily average for the past 20 trading days, according to Thomson Reuters data.

Advancing issues outnumbered decliners on the NYSE by 2,048 to 944. On the Nasdaq, 1,812 issues rose and 996 fell.

The S&P 500 index showed 34 new 52-week highs and no new lows, while the Nasdaq recorded 96 new highs and 22 new lows.