Stocks rallied to close near session highs Thursday, with major averages wiping out the previous session's losses, lifted by a pair of better-than-expected economic data and as investors shrugged off another steep selloff in the Japanese market.

(Read More: After-Hours Buzz: NWSA, RH & More)