A judge has hit out at police and prosecutors after the trial of three people - including a woman who gave birth in custody - collapsed due to "repeated failures".
Judge Gregory Perrins, sitting at Wood Green Crown Court in north London, said there had been "wholesale failure" by the prosecution over its disclosures of evidence in the case of Adrian Iordan, Anisoara Lautaru and new mother Petruta-Cristina Bosoanca.
The trio were originally arrested in connection with allegations of people trafficking and would have attracted lengthy custodial sentences had they been convicted.
But the judge said the Crown Prosecution Service's (CPS) case was "fundamentally undermined" by around 65,000 social media messages, served after the trial began, involving the complainant.
He added: "There have been serious errors in the way in which the prosecution dealt with disclosure throughout 2017. There have been failures by both the police and the CPS."
It echoes the case of 22-year-old Liam Allan, who spent almost two years on bail ahead of a trial which was halted at Croydon Crown Court in December after messages undermining the case were found.
And Oliver Mears, 19, spent two years on bail accused of raping and assaulting a woman in July 2015 before the CPS decided to offer no evidence against him on the basis of fresh evidence.
Speaking at Wood Green Crown Court on Wednesday, Judge Perrins said: "The police and the CPS should have appreciated a long time ago that this was material which potentially undermined their case and disclosed it accordingly.
"The laws of disclosure exist to ensure that a trial is fair. If there is material which either undermines the prosecution case or assists the defendant it must be made available to the defence.
"In this case there were repeated failures to apply the disclosure provisions correctly. There appear to have been failings on the part of both the police and the CPS.
"The effect of these failures has been that material which fundamentally undermines the prosecution case was only disclosed due to the focused efforts of all counsel in the case.
"Had it been made available sooner I have no doubt that the case would have been fully reviewed at a much earlier stage."
The judge said that Miss Bosoanca, 25, of no fixed address, gave birth while in custody awaiting trial.
Her child remained with her in prison throughout the proceedings, the judge said.
Part-way through the trial, prosecutors offered no evidence against Miss Bosoanca, Mr Iordan, 26, of Sandwell, Birmingham, and Miss Lautaru, 20, of Wembley in north London.