Regulators bear much of the responsibility. Before 1999, when Europe forged its monetary union, regulators permitted banks to treat as risk-free the debt of any country that belonged to the Organization for Economic Cooperation and Development, a club of developed nations that includes the United States and most of Europe.

“There was encouragement from European authorities for banks to load up on more debt, because it was seen as safe,” said Nicolas Véron, a senior fellow at Bruegel, a research firm in Brussels. “In hindsight, it was unwise risk management.”

Some regulators realized that allowing banks to set aside no capital for sovereign defaults could be a problem and moved to address it in a 2006 accord known as Basel 2. They mandated that big, complex banks use their own models to determine if individual countries were at risk and hold some capital against them. But the European Union never enforced the stiffer regime. And amid the subprime mortgage crisis, Europe’s regulators added to the problem by demanding that banks hold more safe assets, much of it sovereign debt.

As a result, banks were not discouraged from placing their most liquid assets “into the worst possible government debt,” Achim Kassow, a former Commerzbank board member, wrote in a study published by the European Parliament.

Now, Société Générale, Commerzbank and other banks cannot get rid of the shaky debt fast enough. In the last several months, they have booked billions of euros in losses from unloading it, although their exposure remains substantial. Including the effect of hedges, European banks had a net exposure of about $120 billion to Greek government borrowings and private debt at the end of June, according to the Bank for International Settlements. Even more worrisome, analysts say, is the banks’ exposure of $643 billion to Spain and $837 billion to Italy.

Banks in the United States are also caught in the crossfire. For Italy alone, they had $47 billion in net exposure to government borrowings and private debt at the end of June, the B.I.S. data show.

Goldman Sachs has $700 million in exposure to Italy, according to a regulatory filing released this week, and could feel the fallout if the bonds were marked down.