US stocks closing: U.S. stocks climbed on Thursday on optimism about global growth spurred by stronger-than-expected exports in China, the world's second-biggest economy, and the S&P 500 hovered around a five-year high.
Financial and energy stocks were the day's top gainers in afternoon trading. The financial sector index rose 1 percent and the energy sector was up 0.7 percent.
Financials benefited from events this week that added clarity to mortgage rules and banks' potential exposure to the housing market.
The government's consumer finance watchdog announced mortgage rules on Thursday that will force banks to use new criteria to determine whether a borrower can repay a home loan.
Earlier this week, several big mortgage lenders reached a deal with regulators to end a review of foreclosures mandated by the government.
Bank of America gained 2.6 percent to $11.73, while Morgan Stanley was up 3.2 percent at $20.24, one day after sources said the bank plans to cut jobs.
"It's a resolution. It's not hanging over their heads," said Kurt Brunner, portfolio manager at Swarthmore Group in Philadelphia, Pennsylvania.
Data showed China's export growth rebounded sharply to a seven-month high in December, a strong finish to the year after seven straight quarters of slowdown.
"In and of itself it is being interpreted positively that they've stopped the downturn (in growth)," said Brunner. "If they continue to produce good growth, that's going to be supportive of our global manufacturers."
The benchmark Standard & Poor's 500 index hovered near a five-year closing peak of 1,466.47. On Friday, the index had closed at its highest since December 2007.
"The market is technically right at the level of resistance, near 1,465-1,467," said Randy Frederick, managing director of active trading and derivatives at Charles Schwab.
"A solid breakthrough above the level would be the start of a next leg higher, but it looks like it is going to be difficult to break above that level for now," Frederick said, citing concerns about the corporate earnings season and impending negotiations over the U.S. debt ceiling.
The Dow Jones industrial average gained 40.53 points, or 0.30 percent, to 13,431.04. The Standard & Poor's 500 Index rose 5.41 points, or 0.37 percent, to 1,466.43. The Nasdaq Composite Index edged up 0.42 points, or 0.01 percent, at 3,106.23.
Thursday's session had earlier included a dip that traders said was triggered by a trade in the options market that prompted a large amount of S&P futures to hit the market at the same time.