Jurors deliberated for more than 52 hours over six days before telling the judge they could not reach a unanimous decision on whether the Cosby Show star drugged and molested Temple University employee Andrea Constand at his home in Philadelphia in 2004.
Steven O’Neill, the judge at Montgomery County Courthouse in Norristown, Pennsylvania, then declared a mistrial, adding: “This is not a victory for anyone.”
Montgomery County District Attorney Kevin Steele later said he would immediately retry the case.
He said: “We will evaluate and review our case. We will take a hard look at everything involved, and then we will retry it. Our plan is to move this case forward as soon as possible.”
The jury of seven men and five women had been instructed by the judge to work into the weekend to reach a verdict, after they revealed on Thursday that they were deadlocked.
The 79-year-old had been charged with three counts of aggravated indecent assault. Cosby had faced spending the rest of his life in prison if he was convicted.
Ms Constand told the court in Norristown, Pennsylvania that she had seen Cosby as a mentor figure and went to his home in January 2004 to seek careers advice.
His lawyer claimed the entertainer and Ms Constand were lovers sharing a consensual sexual encounter.
In 2005 Cosby agreed to give a deposition in a civil case brought by Miss Constand. That testimony – in which he admitted giving her the pills, admitted sexual contact and admitted offering to pay for Miss Constand’s university fees – formed the basis of much of the prosecution case.
Cosby’s spokesman suggested that the comedian could testify in his defence, but in the end he declined to do so. The defence only brought forward one witness, a detective who had already testified for the prosecution.
Dozens of women have come forward to say Cosby had drugged and assaulted them, however this was the only case to result in criminal charges against the star to date due to statutes of limitation. He will remain free on bail.
Waking with a cane, Cosby said nothing as he left the court after the jurors were dismissed.
However, Angela Agrusa, one of Cosby’s lawyers, said: “Today was very important. We’ve worked very hard. We want to thank the jury. This is what happens when a prosecution seeks to put someone in prison for something they did not do. The jury was asked to put someone in prison and there was simply not enough.”
A statement was also read out on behalf of Camille Cosby, the star’s wife.
She said: “Historically people have challenged injustices.
“I am grateful to any of the jurors who tenaciously fought to review the evidence, which is the rightful way to make a sound decision.
“How do I describe the district attorney? Heinously and exploitively ambitious.
“How do I describe the judge? Overtly arrogant and collaborating with the district attorney. How do I describe many, but not all, general media? Blatantly vicious entities that continually disseminated intentional omissions of truths for the primary purpose of greedily selling sensationalism at the expense of a human life.”
However Gloria Allred, who represents many of Cosby’s accusers, said: “We can never underestimate the blinding power of celebrity. But justice will come.”
Cosby first came to prominence as the first black American actor to appear in a starring role in a mainstream TV drama, I Spy, in 1965, and became a huge star in the 1980s in the eponymous Cosby Show, playing Cliff Huxtable.