When the financial crisis wreaked havoc across the globe in 2009, a bank manager in the small Italian town of Forni di Sopra decided that he had to do something to help those most affected. In testimony later provided to prosecutors, Gilberto Baschiera described how he increasingly struggled to justify rejecting loan requests from residents who were too poor to qualify.

At the time, the Italian government was desperately trying to prevent the country’s looming bankruptcy, but it kept falling short of targets set by the European Union and other creditors. Amid what he felt was an absence of alternatives, Baschiera decided to take matters into his own hands.

He set up a shadowy banking system in the town of 1,100 people, taking money from wealthy clients and secretly transferring it to the accounts of poorer residents so they could qualify for loans. Within seven years, according to prosecutors, Baschiera diverted 1 million euros.

Then, in 2016, the scheme went bust. Clients had defaulted on their loans and were unable to pay Baschiera back. The system’s implosion turned Baschiera into a hero for some Italian journalists, who compared him to Robin Hood, the legendary English bandit who stole from the rich and gave to the poor.

But authorities were already investigating.

“He trusted that the people he was helping were going to be able to pay back, and some of them didn’t,” Baschiera’s lawyer, Roberto Mete, told the BBC. Mete could not be reached for comment on Thursday.

Investigators determined that Baschiera had not personally benefited from the scheme, a detail that helped him strike a deal with prosecutors. Baschiera was convicted and sentenced on Monday to two years in prison. Thanks to a provision of Italian law that allows courts to show leniency to first-time offenders who were handed relatively short prison sentences, however, Baschiera won’t go to jail.

In similar cases in other countries, courts have been far less forgiving. In 2007, a 45-year-old German banker was sentenced to almost three years in prison after setting up a scheme to divert about $2.4 million (U.S.) from wealthier clients’ accounts to poorer customers whose loan requests would otherwise have been rejected. Two years later, an American court sentenced another bank manager to a year in prison after she diverted more than $300,000 over eight years. The court doubted whether all of the money had in fact been given to people in need.

In Italy, Baschiera’s supporters argued throughout his trial that the former bank manager was left with only painful options after the financial crisis prompted a tightening of loan procedures. Between 2008 and 2011, Italy’s huge debt load quickly became one of the European Union’s most pressing concerns. Some feared that a Greek default could cause a domino effect and drag Italy along with it. Europe later managed to bail out Greece’s comparably small economy, but it might not have been able to rescue Italy — the euro zone’s third-largest economy.

To prevent a default, then-Italian Prime Minister Silvio Berlusconi opted for harsh austerity measures that ended up hindering a vast number of Italians from qualifying for loans.

Berlusconi later went on trial, facing corruption charges and accusations of sex with underage girls, and received several prison sentences. All of the sentences were waived or reduced. Today, Berlusconi and his children are believed to own about $6.8 billion, according to Forbes magazine.

Meanwhile, former Italian bank manager Baschiera would likely not qualify for a loan himself these days: The conviction cost him both his home and his job, according to Italy’s Repubblica newspaper.