Investors were encouraged by several positive economic reports, including a higher estimate of third-quarter U.S. economic growth, an increase in home sales, and a drop in claims for unemployment benefits.
Investors are watching talks between the White House and Congress on avoiding the fiscal cliff.
"Things seem to be moving in the right direction," said David Brown, chief market strategist at the investment research firm Sabrient Systems. "I don't think either party wants to get pinned with hurting the market or the economy."
The Standard & Poor's 500 rose 6.02 points to 1,415.95. The Nasdaq composite index gained 20.25 points to 3,012.03.
In the market for government bonds, the yield on the 10-year Treasury note slipped to 1.62 percent from 1.63 percent late Wednesday.
The clothing maker Guess' stock rose 55 cents to $25.81 after the company joined the ranks of those pledging special dividends to shareholders before favorable tax rates on dividends expire at the end of the year. Guess said it would make a one-time payment of $1.20 per share on top of its regular quarterly dividend of 20 cents.
Dividends, now taxed at 15 percent, will be treated like ordinary income next year unless Congress and the White House extend current tax breaks.
The Commerce Department raised its estimate for U.S. economic growth to an annual rate of 2.7 percent in the July-through-September period. That's much better than the 2 percent rate estimated a month ago and more than twice the 1.3 percent rate logged in the three previous months.
The Labor Department also reported that the number of Americans applying for jobless benefits fell to 393,000 last week, in line with what economists had expected. It was the second straight drop after Hurricane Sandy drove applications higher earlier this month.
The Gap, Target, and other retail stores posted poor sales numbers, driving their stocks lower. It's a crucial time for retailers, who log a huge chunk of their yearly profits in the weeks running up to the holidays.
Kohl's plunged 12 percent, the biggest drop in the S&P 500 index. The company posted a drop in sales and said stores in the Mid-Atlantic and Northeast, areas hit by Sandy, fared the worst. Kohl's stock lost $6.13 to $45.02.
- Kroger Co. rose $1.19 to $26.25 after the supermarket chain reported stronger quarterly profits and raised its earnings outlook for the year. Stronger sales helped the operator of Fred Meyer and Food 4 Less stores post better results than analysts had expected.