The European Central Bank moved decisively Thursday in announcing that it would buy the bonds of struggling governments without limit, an initiative that could save the euro zone and blunt one of the main threats menacing the global economy.

The unprecedented step, meant to reassure fearful investors that euro-zone governments would not default, sparked a rally on world stock markets. U.S. stock indices posted their largest gains in weeks, with the S&P 500 soaring 2 percent and closing at a four-year high.

By committing its massive firepower, the ECB is seeking to ease the pressure on beleaguered European countries that have faced steep and potentially unsustainable costs for borrowing money. A default by a major economy, such as Italy or Spain, could trigger a deep recession in Europe and snuff out the U.S. recovery.

Along with an earlier round of trillion-dollar loans to help stabilize troubled European banks, the ECB has now addressed the two largest threats to the continent’s financial system.

The effect of the bond-buying program unveiled by ECB President Mario Draghi on Thursday was immediate. Borrowing costs for Spain and Italy, which had been drifting downward in recent days in anticipation of the announcement, hit their lowest levels since the spring.

But, by itself, the ECB initiative will not revive Europe’s shrinking economy or cure the region’s chronic problems. Europe’s recession has been proving a significant drag on the global economy and taking a toll on the bottom line of U.S. and other companies that export to the 17-nation euro zone.

On Thursday, the ECB and the Organization for Economic Cooperation and Development forecast that the recession would continue through this year and into the next. The region’s economy suffers from a lack of competi­tiveness in several euro-zone nations, heavy government debt and concerns about whether the currency bloc can survive.

The new program, however, answers a long-standing call by the Obama administration, the International Monetary Fund and many others for the ECB to be more aggressive in tackling the euro zone’s crisis.

“We want this to be perceived as a fully effective backstop,” Draghi said at a news conference in Frankfurt, Germany. “We are in a situation where a large part of the euro area is in a bad equilibrium, where you have self-fulfilling expectations that feed upon themselves and generate very adverse scenarios. There is a case for intervening to break these expectations.”

ECB’s evolving role

By agreeing to buy government bonds when investors balk, the ECB is moving much closer to becoming a “lender of last resort,” a role traditionally played by the U.S. Federal Reserve and other central banks. The ECB was created with a narrower mandate than the Fed or Bank of England, say, and is barred by European treaties from financing individual governments.

Draghi said the new program won near-unanimous support on the ECB board, with only a single dissenting vote. Jens Weidmann, head of Germany’s central bank, has been adamantly opposed to the idea, saying in a recent interview with the news magazine Der Spiegel that the bond-buying initiative would violate the ECB’s legal mandate and was “too close to state financing via the money press for me.”

But German chancellor Angela Merkel, who is the euro zone’s most influential national leader, supported the ECB’s more-aggressive stance, saying at a news conference in Spain that the central bank was “acting with independence and within the framework of its mandate.”

Draghi said the ECB was forced to intervene in bond markets because doubts about the survival of the euro zone had become so corrosive. He said the ECB’s actions were justified because problems in the market for government bonds were undermining the central bank’s chief mission of making monetary policy.

Respite for Spain, Italy

The new action could stem the imminent threat that Italy or Spain would be locked out of world bond markets by rising interest rates and would have to turn to other European countries or the IMF for a bailout. Greece, Ireland and Portugal have received such rescue packages. But Italy and Spain are the euro zone’s third- and fourth-largest economies, and their need for emergency money might exceed the means of the region’s existing bailout funds and could stretch even the IMF’s ability to help.

Efforts by euro-zone leaders to marshal even more money to help cash-strapped bloc members has been constrained by the internal politics of individual nations and the reluctance of wealthier countries to use their tax dollars to help support others.

The ECB has been seen as the only one able to act with the necessary speed and financial firepower to convince global investors that the euro zone will stick together.

“The ECB is there, at the table, in a politically credible manner, and that solves one of the sort of overarching problems that the euro area has had since the beginning — which is what do you do with these countries that are too big to bail out,” said Jacob Funk Kirkegaard, an analyst at the Peterson Institute for International Economics.

The IMF, in an e-mailed statement, called the ECB’s decision “an important step” in responding to the crisis.

It was a long time coming. At the start of the euro-zone crisis, the ECB’s president at the time, Jean-Claude Trichet, rebuffed suggestions that the central bank should have any role in tackling problems rooted in rising government debt. He urged countries to cut their deficits.

The central bank did eventually take some action, including an earlier, more-restricted bond-buying program. But as the crisis escalated, the ECB was pulled toward a far larger role.

Draghi, a native of Italy, found himself fending off suggestions that he was leading a “southern cabal” to wrest euro-zone policy from its traditional mooring in the fiscally conservative and stridently anti-inflation traditions of Germany’s central bank and other northern European nations.

Terms and conditions

The bond-buying initiative comes with conditions. Before the ECB buys a country’s bonds, its government must agree with other European leaders on steps to make its economy competitive, control public debt and address other financial weaknesses.

To ensure that the bond-buying program does not fuel inflation, the ECB’s purchases will be “sterilized.” That means that for every dollar in bonds that the central bank buys, it will withdraw an equal amount elsewhere in the financial system, thus keeping the money supply constant.

Unlike with the earlier bond purchases, the ECB will not demand that it be repaid before other bondholders, Draghi said. That should reassure private investors, who otherwise might have fled Europe for fear that, in any default, they would be at the back of the line for repayment.