U.S. stocks rose in a last-minute rally Wednesday as investors snapped up shares beaten down by worries over deteriorating credit conditions.

The Dow Jones industrial average shot up 150.38 points, or 1.14 percent, to end at 13,362.37. The Standard & Poor's 500 Index gained 10.54 points, or 0.72 percent, to finish at 1,465.81. The Nasdaq Composite Index rose 7.60 points, or 0.30 percent, to close at 2,553.87.

Major stock gauges zigzagged wildly throughout the session. The Dow swung between positive and negative dozens of times and the S&P 500 changed direction even more frequently.

In the final minutes of trading, the Dow shot up around 180 points and then trimmed a modest slice off that gain to close up more than 1 percent -- the mirror image of Tuesday's last-minute swoon by the blue chips.

Shares of United Technologies (UTX), which have fallen 3 percent since last Thursday's stock market slide, rose 2.3 percent and ranked as the Dow's biggest gainer in Wednesday's session. Shares of Merck & Co. (MRK), also among the Dow's major advancers, climbed 2.8 percent. But even with today's gains, Merck has dropped 4.4 percent in the last five sessions.

Rumors swirling around home builder Beazer Homes USA Inc. (BZH) spooked the market at midday. The stock fell as much as 42 percent before recovering somewhat to trade 18 percent lower after Beazer said talk that it would file for bankruptcy was unfounded.

"Talk about a wild ride," said Elliot Spar, market strategist at Ryan Beck & Co. in New York, in his midday market comment. "My short-term memory is poor versus my long term memory and I can't remember intraday volatility like this."

"People have been nervous and when you have these tough markets, you get rallies like this, which are breath-taking," said Bobby Harrington, head of block origination at UBS in Stamford. Connecticut. "I'm still not sure we're out of the woods completely yet, but the bulls won today."

United Technologies, whose products range from Carrier air conditioners to Pratt & Whitney jet engines, advanced 2.3 percent, or $1.68, to finish at $74.65 on the New York Stock Exchange.

Investors remain sensitive to news about worsening lending conditions, which pummeled global equity markets last week. Credit market concerns pushed the S&P 500 down 3.2 percent in July, its worst performance in three years.

Bank and brokerage stocks skidded after Bear Stearns Cos. Inc. (BSC) said it halted redemptions in a hedge fund after nervous investors sought to withdraw money.

Two Bear Stearns hedge funds collapsed last month due to the meltdown in the subprime mortgage market.

Bear Stearns stock lost more ground after news the bank has been sued for allegedly misleading investors about its exposure to subprime mortgages. Bear Stearns shares slid 2.4 percent to $118.30 on the NYSE, while an index of brokers' stocks fell 1.6 percent.

The Dow Jones home builder index closed 0.8 percent lower, after skidding more than 9 percent to its lowest point since 2003 earlier in the session.

A sharp downturn in the price of oil sent energy companies' shares lower. Nevertheless, Exxon Mobil (XOM) shares rose 0.8 percent to $85.84 after swinging between positive and negative throughout the day -- reflecting the market's volatility. Exxon's stock ran from a session high at $86.92 to an intraday low of $83.61.

U.S. crude oil futures dropped sharply, after earlier hitting a record at $78.70 a barrel.

Economic news took a back seat, as volatility gripped the market. The CBOE Volatility Index -- known as Wall Street's fear gauge -- rose to 26.22, its highest level in four years.

U.S. manufacturing grew at a slower rate in July as a drop in new orders spawned caution among factory managers, while U.S. private employers probably added jobs last month at their slowest rate in four years, according to two reports released Wednesday.

In the key housing sector, demand for mortgage applications slid last week to the weakest level in more than five months, an industry group said, suggesting the beleaguered U.S. housing sector has yet to hit bottom.

But in a bright sign for housing, pending sales of previously owned U.S. homes rose at their fastest pace in more than three years in June, a real estate trade group said.

Trading was heavy on the NYSE, with about 2.42 billion shares changing hands, above last year's estimated daily average of 1.84 billion, while on Nasdaq, about 2.96 billion shares traded, also surging ahead of last year's daily average of 2.02 billion.

In spite of the rally late in the day, declining stocks still outnumbered advancing ones by a ratio of about 19 to 14 on the NYSE and by 3 to 2 on Nasdaq.