Europe has put out a brush fire in forging a deal to pare down Greece’s debt and hopefully ward off contagion. 

But the forest is still at risk.

Europe’s economy remains fragile despite an agreement reached Thursday that would slash 50% of Greece’s debt held by private investors, a pact designed to solidify Europe’s banking system and prevent the continent’s debt woes from spreading.

The announcement sent U.S. stock markets soaring on optimism that a problem many feared could push the global economy back into recession may be moving toward a resolution.

“For the first time I think (European leaders) did something constructive,” said Cliff Waldman, an economist for the Manufacturers Alliance/MAPI, a public policy and economics research organization in Arlington, Va.

Waldman said up to now, European policy makers had treated Greece’s fiscal woes as a liquidity problem and their solution was to funnel cash to the beleaguered country, in effect throwing good money after bad. The deal announced Thursday is different in that it acknowledges that Greece is essentially insolvent and cannot pay its debts.

“But this is just a first step,” Waldman cautioned, and Europe’s tenuous economic position still poses a threat to the fragile U.S. economy, he said.

While the long-sought agreement “diminishes the odds” of a double-dip U.S. recession, “it  doesn’t take it off the table,” according to Waldman.

That’s because an agreement that eases Greece’s debt only addresses the fear of contagion and does little to spur real growth within Europe’s sluggish economy.

Naturally, a sluggish European economy dampens demand for U.S. exports there, although the U.S. makes far more products for developing countries in Asian and Latin America than it does for Europe’s advanced markets.

The indirect problem for the U.S. economy is that Europe is a major trade partner with China. If Europe’s slowdown causes a drag on the Chinese economy, that hurts the U.S. because of the close ties between the U.S. and Chinese economies.

So far the fear of contagion stemming from the European debt crisis has been more of a bogeyman than an actual impediment to U.S. economic growth. In other words, more imagined than real.

Many analysts have noted that U.S. economic data have been slowly improving in recent weeks, even as Greece’s debt problems seemed poised to push Europe off the precipice. And U.S. stock markets have bounced back considerably since the bear-market territory they entered over the summer, pushed there in large part by “the fear” of contagion.

Thursday’s stock surge, based largely on the Greek deal, pushed the Dow Jones Industrial average above 12,000 for the first time since August 2.

Peter Cardillo, chief market economist at Rockwell Global Capital, speaking before the Greek debt deal was announced, predicted a “new bull-run based on improved U.S. economic conditions and Europe coming up with a plan to help stem the risk of contagion.”

While consumer sentiment remains in the dumps, recent reports have shown slight improvements in the areas of durable goods, jobless claims, retail sales and even housing starts.

“I think people had really started to become much less worried about the U.S. economy on its own,” said Michelle Girard, senior economist at RBS Greenwich Capital. “The data in the last couple of months had been stronger and not suggested recession. There’s been a nagging concern that the European situation could spill over to the U.S. primarily through a meltdown to the financial markets.”

“The numbers haven’t been necessarily strong but they’re better,” added John Ryding, chief economist at RDQ Economics.

Reduced fear of European debt contagion will undoubtedly spur more risk taking by investors, Ryding predicted, a forecast borne out by Thursday’s rally.

“What will change is peoples’ attitudes toward taking risk,” he said. “People are generally bothered by the uncertainty (surrounding Europe’s debt woes), and that was especially true in early August.”

Ryding said U.S. companies are “generally undervalued” right now, and would remain so until people are more willing to take on risk.

“But once you know that they’ve done enough to contain the problem in Europe, then investors will come back,” he said.

Follow Dunstan Prial on Twitter @DunstanPrial