NEW YORK (CNNMoney) -- Stocks snapped a six-day losing streak on Thursday, with banks, utilities and energy shares leading the advance.
The gains offered some welcome relief for Wall Street investors, who have been feeling the heat during the longest losing streak since July 2010.
"We've gotten to the point of being oversold," said Michael James, senior equity trader with Wedbush Morgan Securities.
The Dow Jones industrial average () gained 75 points, or 0.6%, to close at 12,124; the S&P 500 ( ) added 9 points, or 0.4%, to 1,289; and the Nasdaq Composite ( ) rose 9.5 points, or 0.4%, to end at 2,685.
Shares of Wells Fargo (Fortune 500) and Morgan Stanley ( , Fortune 500) were among the biggest gainers on the S&P 500. Bank stocks are in recovery mode, after falling between 8% and 12% in the past month.,
Still, market sentiment remains pessimistic. The Dow and S&P 500 are still on pace to post their sixth-consecutive weekly loss.
Analysts said trading will likely remain choppy as uncertainty continues to weigh on investors' minds.
"Until we get through the next few weeks and start to see additional economic data, and see what the Fed does in respect to QE2 or a successor to QE2, we're going to be in a period of disappointing news and heightened uncertainty," said Bruce McCain, chief investment strategist at Key Private Bank.
Trading volume was also light, with slightly more than 3 billion shares traded on the New York Stock Exchange, another sign that Thursday's rally might be short lived.
"There's certainly no conviction in this market based on the volume we have," said Ryan Detrick, senior technical analyst with Schaeffer's Investment Research.
Economy: The Labor Department released its weekly initial jobless claims data, showing that 427,000 people applied for unemployment benefits last week. That was slightly higher than expected, and marked the ninth straight week that the figure stayed above 400,000.
The government also issued its monthly report on the U.S. trade balance, showing the gap narrowed to $43.7 billion in April, instead of the expected widening.
Investors also got the Federal Reserve's "Flow of Funds" data, which showed Americans' net worth fell by $16.4 trillion from its peak in spring 2007.
Shares of Fusion-io (Fusion-io priced its IPO at $19 a shares -- above its estimated price range.) surged 18% in their public debut.
Private-equity backed Avaya filed for a $1 billion initial public offering shortly after the closing bell.
J.M. Smucker (Fortune 500) shares rose 2%, after the jam and jelly maker reported a fourth-quarter profit that topped forecasts by a penny per share.,
Shares of Men's Wearhouse () rose 5%, after the company reported earnings more than doubled from a year ago late Wednesday.
Oil for July delivery gained $1.19, or 1.2%, to $101.93 a barrel. On Wednesday, oil prices jumped nearly 2% after OPEC failed to reach an agreement on crude production levels.
Gold futures for August delivery rose $4 to $1,547.70 an ounce. Silver prices jumped 2% to $37.32 an ounce.
Commodities have held up pretty recently, which is good sign for the economic recovery, McCain said.
"I don't think you would be seeing quite as much strength there if it didn't bode well for some sort of economic rebound, at least in the shorter term," he said.
Bonds: The price on the benchmark 10-year U.S. Treasury fell, pushing the yield up to 2.98% from 2.96% late Wednesday.
World markets: European ended Thursday's session broadly higher. Britain's FTSE 100 rose 0.8%, the DAX in Germany gained 1.3% and France's CAC 40 rose 1%.
The European Central Bank left its key interest rate unchanged at 1.25%, as was widely expected.
|What we want Apple to unveil at WWDC|
|Millennials squeezed out of buying a home|
|7 traits the rich have in common|
|Big Data knows you're sick, tired and depressed|
|Your car is a giant computer - and it can be hacked|
|Overnight Avg Rate||Latest||Change||Last Week|
|30 yr fixed||3.83%||3.84%|
|15 yr fixed||2.94%||2.94%|
|30 yr refi||3.83%||3.85%|
|15 yr refi||3.00%||3.01%|
Today's featured rates: