Stocks soared today after European leaders announced a deal to handle Greece’s debt, pushing aside a cloud that has hung over world financial markets most of the year.

At the end of the day, the Dow Jones industrial average increased about 2.9 percent to 12,209 in part boosted by a positive GDP report. The S&P 500 had its biggest monthly rally since 1974, according to Bloomberg, increasing 3.4 percent to 1,285.

The German Dax rose 5.3 percent, and France’s CAC surged 6 percent. Oil prices rose above $94 per barrel and the euro gained strongly, easing worries that the currency would fall apart without a debt deal.

European leaders clinched a deal today that is hoped will end the two-year debt crisis, agreeing after a night of tense negotiations to have banks write down a 50 percent slice of Greece’s debts and to set up a $1.4 trillion rescue fund for other ailing economies in the region, including Italy, Spain and Portugal. Many details of the pact have yet to be worked out.

“We have reached an agreement, which I believe lets us give a credible and ambitious and overall response to the Greek crisis,” French President Nicolas Sarkozy told reporters after the meeting ended early today. “Because of the complexity of the issues at stake, it took us a full night. But the results will be a source of huge relief worldwide.”

After months of dawdling and disagreement, the leaders had been under immense pressure to finalize their plan to prevent the crisis from pushing Europe and much of the developed world back into recession and to protect their currency union from unraveling, the Associated Press reported.

The strategy unveiled after 10 hours of negotiations focused on three key points. These included a significant reduction in Greece’s debts, a shoring up of the continent’s banks, partially so they could sustain deeper losses on Greek bonds, and a reinforcement of a European bailout fund so it can serve as a euro 1 trillion ($1.4 trillion) firewall to prevent larger economies such as Italy and Spain from being dragged into the crisis. That European Financial Stability Facility will grow to four or five times its current size.

Greece was the sticking point in the talks, with Europeans facing a tough choice: Bail out the country, whose debt had soared to 180 percent of its GDP, or allow it to default on its euro-based bonds, leading to a likely collapse of the currency shared by 17 nations. The plan calls for bringing down Greece’s debt to 120 percent of its GDP. By comparison, the U.S. national debt is 84 percent of GDP, Germany’s is 74 percent and France’s is 87 percent.

Countries that joined the euro zone in the late 1990s had to agree to spending and borrowing measures common to all their economies. But there was no effective way to tell which countries were cheating — spending more money off the books and borrowing from banks around the world in euros, then not reporting those sums. The recession that began with the US financial crisis in 2008 quickly spread to Europe, causing tax receipts to fall and governments to go into deep deficits.

Greek leaders exposed a series of cover-ups in their budgets that led to severe austerity measure, culminating with rioting and unrest as well as the eurozone bailout.