(AP) -- Banks and energy companies led U.S. stocks higher Thursday, erasing modest losses from the day before.
Retailers and makers of consumer products also posted solid gains. Small-company stocks rose more than the rest of the market, and technology stocks lagged. Trading was mostly subdued as investors looked ahead to the long holiday weekend.
"Most of the optimism of the tax plan was probably built into the market already and I thought we might be in a little bit of a sideways mode here for a while," said Randy Frederick, vice president of trading & derivatives at Charles Schwab. "But we've pretty much gained back almost what we gave up in the last two days. It's a pretty good sign to see that."
The Standard & Poor's 500 index rose 5.32 points, or 0.2 percent, to 2,684.57. The Dow Jones industrial average gained 55.64 points, or 0.2 percent, to 24,782.29. The Nasdaq composite added 4.40 points, or 0.1 percent, to 6,965.36. The Russell 2000 index of smaller-company stocks picked up 7.03 points, or 0.5 percent, to 1,547.11.
The indexes are all on course to finish the month with solid gains.
They have risen over the past few weeks as Washington moved closer to passing its tax overhaul, but they haven't done much over the last several days as Congress voted on the bill.
On a day when many traders were starting to look ahead to the long holiday weekend, the market received some encouraging data on the economy.
The Commerce Department said Thursday that the U.S. economy grew at a solid 3.2 percent annual rate in the third quarter, slightly slower than previously estimated. The latest GDP estimate follows a 3.1 percent gain in GDP for the second quarter. Combined, the two quarters represent the best back-to-back quarterly growth rates in three years.
"GDP is still strong," said Tom Martin, senior portfolio manager at GLOBALT Investments. "A revision of one-tenth of a percentage point is really not much."
Banks and other financial companies accounted for a big portion of the market's gains. Wells Fargo rose $1.47, or 2.4 percent, to $61.61.
Oil prices veered higher, reversing losses from earlier in the day. The rebound helped lift energy stocks. Hess climbed $2.35, or 5.3 percent, to $46.34.
Benchmark U.S. crude added 27 cents to settle at $58.36 a barrel. Brent crude, which is used to price international oils, gained 34 cents to close at $64.90 a barrel in London.
"You definitely wanted to be long on energy today," Martin said.
Several big retailers and makers of consumer products also posted solid gains. Toymaker Mattel added 59 cents, or 3.9 percent, to $15.71. Luxury Jeweler Tiffany & Co. gained $2.41, or 2.4 percent, to $102.46.
Investors bid up shares in companies that beat earnings or outlook forecasts.
Finish Line jumped 12.9 percent after the athletic shoe and apparel retailer reported its quarterly revenue came in ahead of financial analysts' estimates. It also posted a loss that was more modest than analysts were expecting. Its shares gained $1.51 to $13.20.
Consulting firm Accenture rose 1.6 percent after it reported earnings that beat analysts' estimates. The stock was up $2.45 to $154.20.
Technology stocks, which are on track for an annual gain of 38 percent, the biggest gain this year, lagged the most Thursday.
Micron Technology was among the big decliners in the sector, sliding $1.33, or 2.9 percent, to $44.42.
California utility PG&E plunged 12.9 percent after it suspended its dividend to conserve cash amid concerns that it may be found liable for wildfires in northern California. The stock lost $6.62 to $44.50.
In other energy futures trading, wholesale gasoline rose a penny to $1.75 a gallon. Heating oil added 1 cent to $1.95 a gallon. Natural gas fell 4 cents or 1.5 percent, to $2.60 per 1,000 cubic feet.
Gold rose $1 to $1,270.60 an ounce. Silver fell 4 cents to $16.24 an ounce. Copper added 2 cents to $3.22 a pound.
Bond prices rose. The yield on the 10-year Treasury note fell to 2.48 percent from 2.50 percent late Wednesday.
The dollar fell to 113.35 yen from 113.42 yen on Wednesday. The euro weakened to $1.1873 from $1.1879.
Major stock indexes in Europe closed higher Thursday. Germany's DAX rose 0.3 percent, while France's CAC 40 added 0.6 percent. The FTSE 100 index of leading British shares gained 1 percent. In Asia, Japan's benchmark Nikkei 225 fell 0.1 percent, and the Hang Seng in Hong Kong gained 0.5 percent.