Stocks rose on Wednesday after data showed pending home sales rose to a six-month high in a boost to the fragile economic recovery.

Pending sales of previously owned U.S. homes rose more than expected in April as prospective home owners took advantage of a popular tax credit. The Dow Jones U.S. Home Construction index <.DJUSHB> rose 1.3 percent.

This report is a confirmation that there's housing demand out there, and confirmation of an improving labor market, said Phil Orlando, chief equity market strategist at Federated Investors in New York. All of this suggests that things are improving.

The Dow Jones industrial average <.DJI> was up 66.74 points, or 0.67 percent, at 10,090.76. The Standard & Poor's 500 Index <.SPX> was up 9.10 points, or 0.85 percent, at 1,079.81. The Nasdaq Composite Index <.IXIC> was up 20.33 points, or 0.91 percent, at 2,242.66.

BP Plc rose 1.3 percent to $36.99 as the oil giant worked on a new plan to stem the massive Gulf of Mexico oil spill. The S&P energy index <.GSPE> jumped nearly 2 percent, with Halliburton Co up 7.1 percent to $22.66 and Anadarko Petroleum Corp climbing 3.8 percent to $43.68.

Amgen Inc gained 7.6 percent to $54.50 after the U.S. Food and Drug Administration approved its osteoporosis drug Prolia days after European approval.

JPMorgan Chase & Co rose 1 percent to $38.94 after UBS upgraded the big bank and Dow component to buy from neutral.

In other economic data, the number of planned layoffs at U.S. companies in May was almost unchanged from April, when they touched a four-year low, suggesting employers are more upbeat about the economy.

May auto sales are scheduled to come out Wednesday afternoon.

(Editing by Jeffrey Benkoe)