The former chairman and chief executive of Anglo Irish Bank, Sean FitzPatrick, has been acquitted on all charges against him at the Circuit Criminal Court.
Mr FitzPatrick faced 27 charges of misleading the bank's auditors and furnishing false information about multi-million euro loans to him and to people connected to him between 2002 and 2007.
The prosecution alleged he misled the auditors about the extent of his loans and arrangements in place to refinance them at Anglo's year end.
But Judge John Aylmer ruled this morning on day 126 of the trial that the investigation carried out by the Office of the Director of Corporate Enforcement fell short of the impartial, unbiased investigation that an accused is entitled to.
He said key witnesses had been coached and the ODCE had failed to seek out evidence of innocence as well as guilt.
Instead, he said, they had made assumptions and tried to build a case against Mr FitzPatrick.
The judge said he also had a concern that material shredded by the ODCE's chief investigator during Mr FitzPatrick's first trial may have been material that could have been of assistance to the defence and damaging to the prosecution.
The jury is due to return to court tomorrow morning but will be directed by the judge to acquit Mr FitzPatrick.
Following a media query, the judge said his decision could be reported today.
Outside court, Mr FitzPatrick said it had been a very long, tiring and difficult time for him and for his family.
Former Anglo Irish Bank chairman Sean FitzPatrick thanked his legal team and said "it's a wonderful day for me and my family" pic.twitter.com/lBrAG3Q3N5— RTÉ News (@rtenews) May 23, 2017
Thankfully, he said, the trial is now over. He said it was a wonderful day for him and his family.
He thanked his legal team and asked for his privacy to be respected in the coming days.
He did not answer a question about the investigation and his reaction to the judge's comments.
The trial was the longest criminal trial in the history of the State.
Earlier in court, Judge Aylmer said the most fundamental error was the way the ODCE went about taking evidence from Anglo's auditors Kieran Kelly and Vincent Bergin, both from the firm EY.
He said it was intended that their statements would be taken in the normal way by members of An Garda Síochána, attached to the ODCE.
But he said instead the ODCE obtained the statements through EY's solicitors, A&L Goodbody.
Judge Aylmer, said EY at the time were at risk of being sued by Anglo and were subsequently sued by the IBRC and the ODCE were afraid they would not cooperate.
He said the ODCE completely lost sight of the nature and extent of the evidence in relation to guilt and innocence.
Mr Bergin and Mr Kelly's statements were prepared by EY's solicitors as if this was a civil case. The statements had input from the ODCE who told the solicitors what they wanted them to contain.
He said the ODCE adopted an inappropriate, biased and partisan approach - and were trying to build a case rather than investigating a case impartially.
Much of the case rested on letters of representation signed by directors of Anglo during the audit.
The judge ruled that this issue was not properly investigated.
He said those who prepared the letters of representation in EY and Anglo were not sought out and interviewed, and those in Anglo who knew about Mr FitzPatrick's loans did not give evidence either.
The judge described the shredding of documents by the ODCE's lead investigator Kevin O'Connell as "extraordinary" and said it was not known what might have been in those documents.
He said he had a significant doubt about why Mr O'Connell singled out those documents to be destroyed and disclosed others.
Judge Aylmer said there must be a concern that the documents he shredded were of assistance to the defence and damaging to the prosecution.
He said warnings to the jury would be inadequate to address the issue of the coaching of witnesses.
ODCE accepts criticism
In a statement, the ODCE fully accepted the trial judge's criticism.
But it pointed out the practices highlighted date back to 2009 and the ODCE has "undergone substantial organisational change" since and "is a very different organisation to what it was at that time".
The ODCE said it "was simply not equipped to undertake parallel investigations on the scale involved".
The senior civilian staff who took a lead role in obtaining the Ernst & Young witness statements did not have the relevant training or experience to carry out the task.
Since 2012 the ODCE says its organisational structures have undergone significant change, staffing capabilities have been considerably enhanced, and investigative procedures have been overhauled - with gardaí now taking the lead on all criminal investigations.
In its statement today, the ODCE also references the shredding of a number of documents by one of its staff members.
While accepting "those actions clearly should not have occurred", the organisation said they happened "at a time during which the staff member concerned was under enormous stress and against a backdrop of significant mental health issues".
The staff member concerned was hospitalised for nearly two months in the immediate aftermath of those events.
Labour TD Alan Kelly has called on the Director of Corporate Enforcement in light of the judge's criticism of the office, while Sinn Féin's Pearse Doherty said the State must develop proper infrastructure to tackle white-collar crime.