MARIO (not his real name) from the pretty Italian city of Vicenza opened an account at a local bank in 1992. It afforded him an overdraft of the equivalent of €10,000. He needed it to pay the bills of his wholesale textiles company. Over the years his firm’s cash problems worsened. In 2013, after Mario had exceeded his overdraft limit by €7,000 ($9,300), the bank gave him an unsecured loan of €50,000.

The first repayment was due in January 2014, yet by June Mario had filed for voluntary bankruptcy. The bank—now owed €70,300—presented itself to the court as a creditor. It entered into an arrangement, but in December sold the loan for 5% of its book value to Banca IFIS, an Italian lender building a portfolio of soured debts. Banca IFIS employed an external debt collector and by the following April, Mario had repaid €17,000. Having made a tidy profit on its investment, Banca IFIS told the bankruptcy court the debt had been cleared.

It seems puzzling that Mario was granted a loan after being overdrawn for so long. Andrea Clamer, head of Banca IFIS’s bad-loans division, says such mysteries are central to understanding Italy’s bad-loan mountain. Questionable lending practices, inefficient courts and a long recession all conspired to create €331bn-worth of “deteriorated” loans, including €197bn of non-performing loans (NPLs), by June of last year (see chart). At 21.4% of Italy’s total gross loans, that was over four times the ratio in 2008 and triple the EU average.

ABI, the Italian banks’ association, reckons that 80% of the growth of NPLs can be attributed to the civil-justice system (by far the biggest single factor), sluggish economic growth (the next biggest) and taxation. On average a bankruptcy takes 7.4 years. Only one-quarter of cases are resolved in less than two years. Some last more than two decades.

Bad loans have quadrupled in value since 2008, notes Andrea Mignanelli of Cerved, a data provider. But no bank has quadrupled their staff to manage them. Lenders have been loth to sell their loans. Many have them in their books at around 40% of their face value, whereas investors are prepared to pay around half that. Banks’ capital ratios are already thin; disposals would stretch them further.

Government efforts to boost the market have flopped. GACS, a state-guarantee scheme for NPL-backed securities, has been used just once since its launch in February 2016. Atlante, a private bank-rescue fund set up at the government’s behest partly to kick-start a bad-debt market, has not raised as much capital as hoped. More happily, last year was the first since 2008 in which Italy’s total NPL exposure fell. ABI expects the share of existing loans turning bad to keep falling over the next two years. Last year the stock of bad loans stabilised; in 2017 more are likely to be sold.

Under pressure from the European Central Bank to clean up their balance-sheets, banks are being forced to come up with detailed plans. In February UniCredit, Italy’s biggest bank, agreed a deal with Fortress and Pimco, two funds, to offload €17.7bn-worth of bad loans. Intesa Sanpaolo, the second-biggest, this month committed to reducing its stock of deteriorated credit by €15bn over three years. Monte dei Paschi di Siena, where a government rescue is under way, is due to unveil a new plan for its €27.8bn-worth of NPLs.

Unsecured loans, like Mario’s, account for roughly half the total stock. Much of the rest is secured by property, the value of which crashed in the crisis. In 2014 Algebris, an asset manager, opened an office in Italy to specialise in property-backed bad loans. It has invested most of the €437m it raised for its first fund, and with property prices recovering a little, is now raising a second fund, of around €1bn.

Some accuse the European authorities of having been too severe on Italian banks, which, given more time, might command better prices for their bad loans. On March 20th the ECB appeared to take note. Guidelines to banks again stressed the need to deal with duff loans, but accepted that it could take time. Meanwhile, bad-debt specialists can point to some successes. Credito Valtellinese, a midsized bank, sold its 40-person NPL-management division to Cerved in 2015. The next year collections on bad loans increased by 92%, thanks to a doubling in staff numbers, better IT systems and performance-related pay. Hardly rocket science, but more than Mario’s local bank could have achieved.