The former head of Irish lending at Anglo Irish Bank has said a number of decisions were made by the bank in 2008, which may appear unwise with the benefit of hindsight.
However, the Dublin Circuit Criminal Court heard that in a report compiled in January 2009, Patrick Whelan said these decisions were required to keep the bank alive.
He also said the difficult and traumatic "Quinn saga" had brought them to the very edge.
Mr Whelan is one of three former executives of the bank who are on trial charged with providing illegal loans to 16 people to buy shares in Anglo.
Mr Whelan, Seán FitzPatrick and William McAteer have all pleaded not guilty to the charges.
Mr Whelan has also pleaded not guilty to a further seven charges of being involved in the fraudulent alteration of seven loan facility letters.
Mr Whelan compiled a report in early January 2009 on the efforts by Anglo Irish Bank to "unwind" the large position businessman Seán Quinn had taken in the bank.
Mr Quinn had gambled on the bank's share price through Contracts for Difference, which allow a person to bet on a share without owning it.
He was losing billions of euro as the share price fell.
The transaction executed to unwind the position in July 2008 is at the centre of the trial.
It involved the bank lending money to ten customers of the bank and to six members of the Quinn family to buy the underlying shares.
In his summary of the situation, Mr Whelan said Mr Quinn had put the bank in a very difficult and vulnerable position.
He said a number of decisions made during this difficult period were required to keep the bank alive but with the benefit of hindsight may appear unwise.
These included the continued support of Mr Quinn by the bank by providing him with working capital, the introduction of ten of the bank's most loyal customers into the transaction to unwind the position and an effort to protect those customers by a proposal to amend their level of liability for the loans.
Mr Whelan said all these decisions were made in the best interests of the bank, its shareholders, depositors and clients in a period which had felt like they were under attack on all fronts.
He said the Quinn saga was very difficult and traumatic for the bank and everyone involved and had brought them to the very edge.
However, he said he believed Mr Quinn had the financial strength to come through this.
Letters sent to some of Maple Ten
The court also heard about letters sent to a number of the so- called Maple Ten group of borrowers who had bought Anglo shares, as part of the Quinn transaction, which appeared to reduce their liability to repay their loans.
The court has heard the Maple Ten were each lent around €45 million by Anglo Irish Bank to buy shares in the bank as part of the transaction to unwind Mr Quinn's position.
The original loan facility letters issued in July 2008 made each of them personally liable to repay 25% of the loans.
However, the court has heard further letters were prepared in October 2008 which removed the personal liability of the borrowers to repay any of the loans – these letters were dated 17 July 2008.
In his report compiled in January 2009, Mr Whelan said that the bank understood the concerns of the ten individuals as the bank's share price continued to fall after July 2008.
There was concern that the bank might be taken over or merged with another institution.
He said their support for the bank had put them at risk and the bank needed to ensure they were given time to deal with the issue.
Mr Whelan said Anglo's then chief executive David Drumm agreed the bank had a duty to protect these clients. He said Mr Drumm agreed they would prepare letters for each of the clients changing the recourse element to create uncertainty.
He said that Mr Drumm said these letters were not to be posted but kept on the clients' files and used only if required. But he said due to a "clerical error" the letters were sent out to some of the ten investors.
In his report he said the concept of these "protection letters" was an error of judgement, on reflection.
He said they should not have been issued. Mr Whelan said despite the approval of Mr Drumm, they should have been brought to the board.
In an interview with gardaí, Mr Whelan said he had been asked by Mr Drumm to get the lending team to prepare the letters.
Mr Whelan said it was unusual to backdate facility letters but it happened.
He said his understanding was that Mr Drumm was going to seek approval from the bank's board before issuing the letters.
He said his concern was that the letters had gone out without the proper authorisation and debate about the change in the terms of the loans.
Mr Whelan also told gardaí that he understood the lending by Anglo to Quinn family members and the Maple Ten borrowers did not involve multiple breaches of the 1963 Companies Act, as suggested by the gardaí.
He said his understanding was that there was an exception under Section 60 of the Act which prohibits financial assistance by a company to buy its own shares.
Mr Whelan said under this exception banks could lend to purchase their own shares because it was in the normal course of business of a bank.
He said the Financial Regulator and investment bank Morgan Stanley were involved in the transaction and did not raise any concerns.
The court has also been hearing details of garda interviews with William McAteer, who was finance director of Anglo Irish Bank.
Mr McAteer was asked if it was normal for a bank to lend money to clients to buy shares in the bank.
Mr McAteer said a bank's business was to lend money providing it was happy with the people it was lending to and their cashflow and collateral were high.
He said it was as good a reason as any.
He also told gardaí he was not aware that the bank lent money to the Quinn family members as part of the transaction.
He said he thought they were being funded out of the Quinn group.