NEW YORK (AP) - An agreement to contain the European debt crisis electrified the stock market Thursday, driving the Dow Jones Industrial average up nearly 340 points and putting the Standard & Poor's 500 index on track for its best month since 1974.
Investors were relieved after European leaders crafted a deal to slash Greece's debt load and prevent the crisis there from engulfing larger countries like Italy. The package is aimed at preventing another financial disaster like the one that happened in September 2008 after the collapse of Lehman Brothers.
But some analysts cautioned that Europe's problems remained unsolved.
"The market keeps on thinking that it's put Europe's problems to bed, but it's like putting a three-year old to bed: You might put it there but it won't stay there," said David Kelly, chief market strategist at J.P. Morgan Funds.
Kelly said Europe's debt problems will remain an issue until the economies of struggling nations like Greece and Portugal grow again.
Commodities and Treasury yields soared as investors took on more risk. The euro rose sharply against the dollar.
Stronger U.S. economic growth and corporate earnings also contributed to the surge. The government reported that the American economy grew at a 2.5 percent annual rate from July through September .
on stronger consumer spending and business investment. That was nearly double the 1.3 percent growth in the previous quarter.
Banks agreed to take 50 percent losses on the Greek bonds they hold. Europe will also strengthen a financial rescue fund to protect the region's banks and other struggling European countries such as Italy and Portugal.
"This seems to set aside the worries that there would be a massive contagion over there that would have brought everything down with it," said Mark Lamkin, head of Lamkin Wealth Management.
The Dow Jones industrial average soared 339.51 points, or 2.9 percent, to 12,208.55. That was its largest jump since Aug. 11, when it rose 423.
All 30 stocks in the Dow rose, led by Bank of America Corp. with a 9.6 percent gain. It was the first time the Dow closed above 12,000 since Aug. 1.
Even with Thursday's gains, the Dow remains 4.7 percent below the high for the year it reached April 29. The Dow has fallen every month since then due to a combination of a slowdown in the U.S. economy, a worldwide parts shortage after the earthquake and tsunami in Japan, and concerns about the European debt crisis. The Dow is now at approximately the same level it traded at on July 28.
Stocks fell for much of August in the wake of a last-minute deal to prevent the U.S. government from defaulting on its debt.
But anticipations of a solution to Europe's debt problems and signs that the U.S. economy is not in another recession have lifted stocks higher throughout October.
The Dow is up 11.9 percent for the month so far. With only two full days of trading left in the month, the Dow could have its biggest monthly gain since January 1987.
The S&P 500 rose 42.59, or 3.7 percent, to 1,284.59. Those gains turned the S&P positive for the year for the first time since Aug. 3, just before the U.S. government's debt was downgraded. The index is up 13.5 percent for the month, its best performance since a 16.3 percent gain in October 1974.
The Nasdaq composite leaped up 87.96, or 3.3 percent, to 2,738.63.