Two former Anglo Irish Bank executives have been spared jaily despite being found guilty of handing out illegal loans from the financial institution at the heart of Ireland's economic collapse.

Justice Martin Nolan said it would be wrong to jail Patrick Whelan, the bank's former head of lending in Ireland, and William McAteer, its former chief risk and finance officer, because the then financial regulator failed to warn them about the illegality of their attempt to prop up the bank's share price with a loan scheme.

Neither of the men – who were given community service instead – made any comment to the media as they left the court in Dublin on Tuesday afternoon.

The judge said it would be unjust to impose custodial sentences after Whelan, 52, and McAteer, 63. The pair had faced up to seven years in prison after being convicted of breaking the law by lending tens of millions of euros to 10 investors just months before Anglo Irish imploded.

The decision not to send the duo to jail is likely to cause outrage across Ireland given that the Irish taxpayer had to pay more than €30bn (£24.6bn) to prevent the bank's collapse in late 2008.

Propping up Anglo Irish and two other banks accused of reckless conduct pushed the Irish Republic to the edge of bankruptcy and forced the previous government to seek a €67.5bn (£55bn) bailout from the International Monetary Fund, the European commission and the European Central Bank.

In a pointed reference to Ireland's financial watchdog at the time, the judge told the court: "I find it incredible that red lights did not go off somewhere in the regulator's office."

During the trial lawyers for Whelan and McAteer said both men did not know they were doing anything illegal in relation to a loan to the Maple 10 group of investors in the summer of 2008, and believed they had been given the legal green light for the deal from the regulator.

Brendan Grehan, Whelan's senior counsel, said: "[The banker] didn't for one moment think he was involving himself in something that was unlawful, something that would find himself before a court on indictment." Patrick Gageby, for McAteer, said there were no malign intention on the part of his client, unlike many other white collar crimes which were committed from "a base motive".

Whelan and McAteer's convictions followed the acquittal of former Anglo Irish chairman Sean FitzPatrick, who was cleared of 16 similar charges. All three had denied the charges.

The trial focussed on a deal to try and reduce the influence of Ireland's one-time richest man Seán Quinn who held millions on future shares in Anglo Irish Bank In the summer of 2008 the bank tried to sell on Quinn's control of those shares to the Maple 10 group, which the jury found was an illegal transaction in the case of McAteer and Whelan.