NEW YORK — The last time the stock market was this high, the Great Recession had just started, and stocks were pointed toward a headlong descent.
But on Thursday, the Dow Jones industrial average hit its highest mark since December 2007, and the Standard & Poor's 500 index soared to its highest level since January 2008 in a rally that seemed destined to mark a milestone: American stocks have come almost all the way back.
A long-anticipated plan to aid struggling countries in the European Union provided the necessary jolt, and the gains were extraordinarily broad. All but 13 stocks in the S&P index were up. European markets surged, too.
"There's just a sea of green," said JJ Kinahan, TD Ameritrade's chief derivatives strategist. "It's pretty fun."
At the start of 2008, the U.S. economy was already a month into recession, though most people scarcely knew it at the time. The S&P had recently hit an all-time high, and the unemployment rate was 5 percent, compared with the current 8.3 percent.
Then, in March 2008, the investment bank Bear Stearns collapsed under the weight of bad mortgage bets, and investors began to sell. In September, the full financial crisis took hold as Lehman Brothers filed for bankruptcy, banks stopped lending to each other and investors began dumping stocks in earnest.
By March 2009, the S&P had dropped 57 percent from its high to hit a 12-year low of 676.
Since then, the index has been on an impressive if often bumpy climb. Helping to power it was unprecedented support from the Federal Reserve, which critics say has reignited a dangerous gambling spirit among professional investors, and record profits at big U.S. companies.
Although stocks have rebounded, the broader economy is still lagging. But Barry Knapp, head of U.S. equity strategy at Barclays Capital, said stocks tend to anticipate the future economy rather than reflecting current conditions. So the signs are good.
"It can be a misleading forecasting tool, but sometimes it's telling you something significant," he said. "It's entirely possible the stock market is telling us that there is a better economic environment out there."
If you started off 2008 by putting $10,000 in the S&P 500, the benchmark for most stock funds, you would now have $10,600, thanks to dividends. That's assuming you could stomach the ride. Your initial investment fell to $9,840 six months later, then plunged to $6,300 by the following January.