U.S. stocks rose on Wednesday as investors grabbed shares beaten down in Tuesday's sell-off and data showed pending home sales rose more than expected.

The major indexes advanced more than 1 percent, reversing Tuesday's slide in which energy shares had tumbled. Stocks have struggled to build upward momentum since reaching a 19-month high on April 23, with the S&P 500 climbing from recent support at 1,060.

Pending sales of previously owned homes increased to a six-month high in April, a real estate group reported.

The data is somewhat supportive. It came in above estimates, said Richard Sparks, senior equities analyst at Schaeffer's Investment Research in Cincinnati, Ohio.

It's more of a function of trying to get something mounted to the upside here -- it looks like we are trying to construct a little bit of a bounce from that 1050-1060 level.

The Dow Jones industrial average <.DJI> gained 119.94 points, or 1.20 percent, to 10,143.96. The Standard & Poor's 500 Index <.SPX> climbed 15.10 points, or 1.41 percent, to 1,085.81. The Nasdaq Composite Index <.IXIC> rose 31.41 points, or 1.41 percent, to 2,253.74.

Pending home sales rose as prospective home owners took advantage of a popular tax credit. The Dow Jones U.S. Home Construction index <.DJUSHB> rose 1.3 percent.

Energy shares were among the best performing stocks, recovering after the latest failed attempt by BP Plc to halt the oil spill in the Gulf of Mexico and the news that the U.S. government had launched a criminal probe into the disaster.

But U.S.-listed shares of BP climbed 2.5 percent to $37.44 as it worked on a new plan to halt the spill. The PHLX Oil Service Sector index climbed 3.7 percent as Halliburton Co jumped 9.8 percent to $23.21 and Schlumberger Ltd advanced 7.6 percent to $55.71.

Amgen Inc helped boost the Nasdaq, gaining 8.4 percent to $55 after the U.S. Food and Drug Administration approved its osteoporosis drug.

JPMorgan Chase & Co rose 1 percent to $38.94 after UBS upgraded the bank.

(Reporting by Chuck Mikolajczak; Editing by Kenneth Barry)