A jump in telecommunications and health-care shares helped stocks settle in the black after major indexes were briefly whipped around by fiscal-cliff worries.
The Dow Jones Industrial Average advanced 36.71 points, or 0.3%, to 13021.82. The Standard & Poor's 500-stock index rose 6.02 points, or 0.4%, to 1415.95, as all 10 sectors rose. The Nasdaq Composite Index rose 20.25 points, or 0.7%, to 3012.03.
Major benchmarks were higher most of the morning, but markets reversed course after House Speaker John Boehner said in a news conference that there had been no substantive progress in talks on the so-called fiscal cliff. The blue chips lost more than 50 points in five minutes as he spoke.
"It's amazing how quick the reactions are. Two sentences come out and it moves the market 50 points," said Alan B. Lancz, president of Alan B. Lancz Associates, in Toledo, Ohio. "Europe is off the radar, and the economic numbers are kind of meaningless. It's all trumped now by the fiscal progress, or lack thereof."
The slide soon halted after comments from other lawmakers. Senate Majority Leader Harry Reid said that he thought Congress could finalize a deal this year, and Sen. Charles Schumer said that lawmakers are making progress on talks behind the scenes.
"I think we're going to have these markets that react to every single headline. I think an agreement will be reached, and we're likely to see a relief rally at the end of it. But until then, hold on to your seat," said Joseph Tanious, global market strategist with J.P. MorganJPM +0.96% Funds, which oversees $400 billion.
When stocks moved back into the black, the traditionally defensive telecom and health sectors were the biggest gainers.
On the economic front, pending home sales rose 5.2% in October from the prior month, above the 1% increase expected.
The number of Americans filing initial claims for unemployment benefits fell slightly more than expected last week, to 393,000. Meanwhile, U.S. gross domestic product rose 2.7% in the third quarter, the Commerce Department said. The reading represented an upward revision from the 2% gain the department initially reported—economists expected a revision to 2.8%.
In corporate news, shares of Kohl's KSS -11.98% slid after it said that same-store sales for November fell 5.6%, when a 1.9% rise was expected.
Research in Motion RIM.T +4.36% rallied after Goldman Sachs GS -0.50% analysts recommended buying the shares, citing a "positive" risk-versus-reward outlook as the company prepares to start selling its BlackBerry 10 smartphone. Research in Motion's shares had tumbled 23% this year through the latest close.
European markets were broadly higher. The Stoxx Europe 600 ended up 1.2%. In Asian markets, Japan's Nikkei Stock Average rose 1% and Australia's S&P ASX 200 gained 0.7%. China's Shanghai Composite continued to buck the trend, shedding 0.5% for a fourth-straight loss and the lowest close in nearly four years.
Front-month oil futures rallied 1.9% to settle at $88.07 a barrel, while December gold futures tacked on 0.6% to $1,727.20 a troy ounce. The dollar lost ground against the euro and the yen. Yields on the benchmark 10-year U.S. Treasury bond rose slightly to 1.620% as prices fell, snapping a three-day streak of yield losses.
Elsewhere in corporate news, Kroger KR +4.75% rose after the grocery-store operator reported better-than-expected earnings and raised its profit forecast for the year.
Tiffany slumped after the high-end jewelry retailer reported earnings that fell short of expectations, and lowered its full-year outlook.
Guess GES +1.94% gained after the apparel company said it would pay a special dividend of $1.20 a share, news that outweighed fiscal third-quarter results that missed analyst projections.
Aeropostale ARO -4.96% slid after the youth-focused apparel company reported earnings that were better than Wall Street expected, but gave a dour outlook for the current quarter.
Infoblox BLOX +29.53% soared after the data-center technology company reported a blowout fiscal first quarter with earnings and revenue that were well above expectations, and provided an upbeat second-quarter outlook.