Fresh US economic data showed a pickup in US housing starts after two slower months, an encouraging sign for the construction sector, and also tepid inflation, with consumer prices rising just 0.1 percent in July.

"We have fundamentals that have improved and the market now seems to be less focused on geopolitical concerns," said Peter Cardillo, chief market economist at Rockwell Global Capital.

TJX, which owns retailers Marshalls, TJ Maxx and other discount retail chains, bolted 8.7 percent higher as it boosted its full-year outlook following a better-than-expected second quarter. The company now sees fiscal 2015 earnings of $3.10-$3.18 a share, compared with last year's $2.83 per share.

Apple, the iPhone maker and world's largest company by market capitalization, set a new high, its shares reaching $100.68, better than the previous high hit nearly two years ago, before the stock's seven-to-one split, of $705.07.

Apple shares closed up 1.4 percent at $100.53, also a new closing record.

Salix Pharmaceuticals jumped 150.5 percent on reports that Allergan might make a bid for it as part of its effort to fend off a takeover effort from Valeant.

Bond prices slipped. The yield on the 10-year US Treasury rose to 2.41 percent from 2.39 percent Monday, while the 30-year hit 3.22 percent, up from 3.19 percent. Bond prices and yields move inversely.