A US judge has declared a mistrial in the Bill Cosby sex assault case after the jury remained deadlocked for days.
The seven men and five women were unable to reach a unanimous decision after some 53 hours of deliberations in Norristown, Pennsylvania.
Mr Cosby, 79, is accused of drugging and sexually assaulting Andrea Constand in 2004. His lawyers had argued the sex was consensual.
The US comedian could now face new proceedings.
He walks away from court a free man, but the prosecution has already said they are pursuing a fresh trial.
Dozens of women say he assaulted them, but statutes of limitation rules mean he was allowed to be tried for Ms Constand's allegation only.
The veteran entertainer could have faced up to a decade in prison if found guilty of three counts of aggravated indecent assault, which allegedly took place at his Philadelphia home 13 years ago.
Announcing the decision, Pennsylvania judge Steven O'Neill reminded Mr Cosby that he remains charged and on bail, despite the mistrial.
The BBC's Aleem Maqbool, inside the courthouse, said Mr Cosby was expressionless when the decision was announced.
One of Mr Cosby's lawyers, Brian McMonagle, applauded the decision, saying: "The judge is right: justice is real."
"We came here looking for an acquittal. But like that Rolling Stone song says 'you don't always get what you want'. Sometimes you get what you need."
The district attorney who brought the charges, Kevin Steele, told reporters that the prosecution was seeking a retrial:
"We will evaluate and review our case. We will take a hard look at everything involved and then we will retry it. As I said in court, our plan is to move this case forward as soon as possible."
A lawyer representing many of Mr Cosby's accusers, Gloria Allred, said she was hoping the prosecution would try the case again.
"We can never underestimate the blinding power of celebrity but justice will come."
The jury had been instructed by the judge to work into the weekend to reach a verdict, after they first revealed that they were deadlocked on the case on Thursday.
But the panel returned again on Saturday to tell the judge they were still deadlocked on all three counts.
Some of the many women who accused Mr Cosby of drugging and assaulting them over a 40-year time span were present in court last week awaiting the verdict.
The accuser, Constand Andrea, took the stand during the trial, telling the court the assault had left her feeling "humiliated" by someone she considered a friend and mentor.
Mr Cosby, who faces at least four separate civil lawsuits, refused to testify at the trial.