Stocks rose on Wednesday as investors snapped up beaten-down shares after a three-day slide and a nearly 2 percent jump in oil prices boosted demand for energy companies.

Major indexes had fallen earlier in the day after weaker-than-expected durable goods data.

Shares of Bear Stearns Cos. rose 2.8 percent to $143.31. Sources said the company made moves to bolster its two troubled hedge funds.

Apple Inc.'s shares rose 1.9 percent to $121.89 after Wall Street Journal technology reviewer Walter Mossberg strongly endorsed the company's iPhone, which Apple will start selling on Friday.

A sharp rise in crude oil prices after the government reported a surprise decline in U.S gasoline supplies last week lifted shares of Exxon Mobil Corp. and other energy companies. Exxon was up 2 percent at $83.48.

Strength in technology and energy helped push aside the market's concerns about the turmoil in the subprime mortgage market, which contributed to three straight sessions of losses, and stocks extended gains just before the close.

The market's at levels now where we can start to withstand some of the news regarding the subprime woes, said Steve Goldman, market strategist, Weeden & Co. in Greenwich, Connecticut.

The Dow Jones industrial average was up 90.07 points, or 0.68 percent, at 13,427.73. The Standard & Poor's 500 Index was up 13.45 points, or 0.90 percent, at 1,506.34. The Nasdaq Composite Index was up 31.19 points, or 1.21 percent, at 2,605.35.

On Friday, Bear Stearns said it would bail out one of two hedge funds it manages that has invested in debt backed by subprime mortgages -- raising concerns that other investment banks, hedge funds and investors may have to take losses on their portfolios of collateralized debt obligations. Financial shares fell after the news, extending losses this week.

The S&P financial index rose 0.8 percent on Wednesday.

Oracle Corp., the world's third-largest software company, reported a higher quarterly profit late on Tuesday, prompting higher price target on the shares by several brokerages. Oracle shares rose 2.8 percent to $19.69 on the Nasdaq.