The S&P 500 finished above 2,000 for the first time Tuesday, capping a steep climb from 676 in March 2009, when the market hit bottom during the Great Recession.
But the narrower Dow Jones Industrial Average of blue chips missed its record, set in July, by a small gap at the close after having surged past it during trade.
Wall Street sustained its seeming indefatigable bull run helped by more encouraging data on the US economy, with consumer confidence and durable goods orders showing solid improvement.
Also helping was the rally in Europe's bourses, despite more poor economic data and turmoil in the French government.
Signals from the European Central Bank have bolstered confidence that the eurozone won't be allowed to sink back into recession, said analysts.
Meanwhile, the markets in general have also brushed off geopolitical tensions in Iraq, Syria, Libya and Ukraine, after months of remaining on edge with each new development in those conflict zones.
The S&P 500 only narrowly broke the barrier. It closed at 2,000.02, up 2.10 points (0.11 percent) for the day. The broad market gauge has gained more than eight percent since the beginning of the year. But it took over 16 years to reach 2,000 after it first passed 1,000 in February 1998.
The Dow rose 29.83 points (0.17 percent) to 17,106.70, still shy of a new record. During trade it had climbed to 17,153.80, about 15 points above its previous closing high.
Meanwhile the Nasdaq Composite Index, rich in tech stocks, pushed to 4,570.64, up 13.29 points (0.29 percent). That was its highest point in 14 years, but still well below the 1,500 peak reached in March 2000 before the steep dot-com crash.
Passing the 2,000 barrier was mostly a psychological achievement, noted Michael James of Wedbush Securities.
He said traders might be poised to sell on Wednesday after passing the mark, but overall sentiment is strong for US stocks.
"Right now, the US remains the best place to be."
Twitter led the largest companies higher, adding 4.5 percent after announcing that it had expanded its ad sales across Europe.
Amazon added 2.34 percent, helped by its late-Monday announcement of a $970 million deal to buy videogame streaming website Twitch.
Fast-food chains Burger King and Tim Hortons announced a deal in which Burger King would pay $11.4 billion in cash and stock for the Canadian company and move its headquarters to Canada, though Burger King denied the move was to take advantage of cheaper corporate taxes.
Shares of both had risen sharply on Monday when news of the deal leaked out. On Tuesday after the announcement, Burger King shares finished down 4.3 percent while Tim Hortons, traded on the Toronto exchange, added 8.5 percent.
Best Buy, fighting back against online electronics sales with its own double-edged Internet and traditional showroom strategy, reported solid profit gains in its fiscal second quarter. Earnings per share rose to 44 cents from 32 cents a year ago, even though revenue fell 3.2 percent to $8.9 billion.
But the company made a weak forecast for the year-end holiday shopping season, sending its shares down 6.9 percent.