The fifth anniversary of the global debt "jubilee" was a sombre affair. World leaders, many still representing governments of national unity, reconvened at the Excel Centre in east London to consider what they had achieved with that fateful G20 conference of spring 2009.

So much had changed since, it was hard to remember what led them to take such radical action. The decision to forgive trillions of dollars of debt in a co-ordinated programme of bankruptcy followed months of desperate measures to prop up the teetering financial system. The economy had been in freefall: not just in the US and UK, but throughout the industrialised world. By February of 2009, the German economy was shrinking by 8% annually, Japan's by 12% and Korea's by 20%. This was not a recession or a depression; it was the unravelling of global capitalism. A series of apparent frauds had made household names of men such as Bernard Madoff and shaken investor confidence to the core. Critics like Nouriel Roubini had begun to wonder if the banks were not too big to fail, but too big to save.

At the time, the London summit felt like a natural continuation of the bail-outs that began following the collapse of Lehman Brothers six months earlier. Banks had been lent money; then given money; then encouraged to print new money. Now, the private pain had become a public nightmare. As governments came closer to fully nationalising big banks, worries spread about the solvency of whole countries: Iceland, Greece, Spain, Italy, Belgium, Switzerland and, perhaps even the UK itself.

By the time Gordon Brown hosted world leaders at the London conference, all this talk of nationalisation, creating "bad" banks and guaranteeing toxic loans began to coalesce into a bigger idea: what about writing a line under the whole affair and trying to move on?

Drawing on his experience of negotiating debt forgiveness for developing countries, Brown proposed a series of bilateral debt write-offs and prepackaged bankruptcies. If most of the major banks were in the hands of governments, then many of their liabilities were to each other. Hundreds of billions of dollars of credit derivatives, asset-backed securities and mortgage securitisation were in effect owned by the public and could be netted off.

With hindsight, it was a breakthrough, even reminiscent of the Old Testament notion of "jubilee" - a time of debt forgiveness held every 50 years. In practice, not all of this debt was wiped out (much was simply restructured or converted into shares) but the effect was as radical as the Bretton Woods conference which rewrote the rules of international finance after the devastation of the second world war.

At first there was a carnival mood, almost revolutionary. Did this mean all those credit card debts and mortgages could be forgotten too? Should people rush to borrow while they could? Then the reality sank in. For every debt, there is a saver expecting to be paid. To prevent social breakdown, governments needed to protect ordinary savings deposits up to an agreed maximum. To fund this, the majority of personal and corporate loans were maintained - returning retail banking to its traditional model of balancing saving deposits with borrowing. Other debts were merely postponed, giving highly indebted companies and households a breathing space.

The real losers were big institutional investors, in particular the pension funds and insurers that make up the bulk of the world's investment capital. This meant many pension schemes had to be given public support too so they could honour their future commitments. Yet in practice this merely formalised the implicit public guarantee behind many of the world's existing pension commitments.

All this came at enormous political cost. The loss of savings for wealthier individuals and institutions was enormous. It exacerbated existing tensions in society and left generations of savers feeling bitter and conned. The legal action would stretch on for decades.

But it worked. The real economy was able to slowly recover. Five years on, the world is still in the grip of a major slump, yet large-scale unemployment is restricted to a few industries such as financial services and property. The global agreement helped silence the rising protectionist voices that threatened to cripple world trade. Politicians were able to nurture more sustainable industries and wean their economies off the debt addiction more peacefully.

Bankruptcy is a process designed to help individuals and companies move on from unpayable debts. When the whole system is bankrupt, the principle can work on a bigger scale too. Uncontrolled bankruptcies spread panic, but agreed ones can be cathartic. The politicians gathered in London for the reunion decided it was a price worth paying.