The former head of group compliance at Anglo Irish Bank has told the Anglo trial that the Financial Regulator had no objection to the transaction that is now the subject of criminal charges at the Dublin Circuit Criminal Court.
The bank's former chairman Seán FitzPatrick and two former directors of the bank, Patrick Whelan and William McAteer, deny giving unlawful loans to 16 people to buy shares in the bank.
Mr Whelan denies being involved in fraudulently altering seven loan facility letters.
Fiachra O'Neill was appointed head of group compliance at Anglo Irish Bank in 2007, despite having no regulatory or compliance experience.
When he raised this with his bosses, he was told he had the right skillset for the job and there were very experienced bankers heading up the various teams who would support him.
He said he was made aware of the problem with Seán Quinn's interest in the bank through Contracts for Difference in late March 2008.
On 9 July that year, he was called into a meeting with his boss, Matt Moran, and Anglo's finance director, Mr McAteer.
He said he was told the Financial Regulator was putting pressure on the bank to deal with the situation and he was informed the bank was to lend money to Quinn family members and ten customers of the bank as part of a plan to unwind Mr Quinn's position.
He said he was told the board of the bank was fully aware of and approving of the transaction.
Three days later, he was on a conference call with representatives of global investment bank Morgan Stanley and Con Horan, who was second in command in the Financial Regulator's office.
He said Morgan Stanley personnel asked Mr Horan if the Financial Regulator approved of the transaction. According to Mr O'Neill, Mr Horan said: "The Financial Regulator has no objection to the transaction."
The court heard Mr O'Neill has been granted immunity from prosecution.
Earlier today, a senior executive from Morgan Stanley told the trial that the 2008 transaction seemed to be an "elegant solution" to the problem of unwinding Mr Quinn's stake in the bank.
Joel Carter gave evidence via video link from London.
Mr Carter was a vice president of the global capital markets division of the investment bank, when he was involved in the unwinding of the stake Mr Quinn had in the bank through Contracts for Difference in July 2008.
Mr Carter said he understood the reason for the transaction was that the Financial Regulator was concerned about the build up of a position through CFDs and the lack of market transparency, and wanted to find a way of dismantling the position.
He said that the fact that the Financial Regulator was encouraging the unwinding is what made Morgan Stanley comfortable with the transaction in the first instance.
Mr Carter said the fact that Anglo had sourced investors to buy the underlying shares appeared to be a very neat solution to the problem of unwinding the position. He said it seemed to be on the face of it an elegant solution.
He said he participated in a conference call with Mr Horan on 12 July 2008.
Mr Carter said he did not think the fact that Anglo was lending money to the ten customers to buy the shares was on the agenda for the conference call.
He said his impression of Mr Horan's attitude was that he was comfortable with the transaction and that he was satisfied with the way the CFDs were being unwound.
Mr Carter said he was aware Anglo was lending money to the investors to buy the shares.
He also said that he was involved in calling the banks who had provided Mr Quinn with the CFDs as part of the unwind process.
Mr Carter agreed that he and his colleagues had a prepared script that said that the financial regulators in the UK and Ireland were aware of the proposed transaction and had not raised any objections, and in particular were happy the CFDs were being unwound in this way.