(UPDATED WITH D.A. ANNOUNCEMENT) A mistrial has been declared today in Bill Cosby’s criminal trial for the 2004 rape of Andrea Constand. The decision has for now spared the once-beloved actor from a potential decade behind bars, and comes at the end of over 50 hours of deliberation by the jury in Norristown, PA, which first went to Judge Steven O’Neill on June 15 to say it was deadlocked – at that time he told them to “try again,” which they’ve done for the past two days.

After just over an hour of deliberations on Saturday, the jurors informed the court that they were still “hopelessly deadlocked” on all the charges.

“After 52 hours of deliberation, probably one of the most courageous acts I’ve ever seen, I’m compelled to grant a mistrial,” said Judge O’Neill to the packed courtroom. Constand and several police officers who worked on the case were in the courtroom when the mistrial was announced today, as was Bill Cosby.

Related Story Bill Cosby Jurors Working Saturday After No Verdict This Week

Not that this is all over for the 79-year old Cosby – at least not yet. Within minutes of the mistrial being declared, the Montgomery County District Attorney’s office announced in court and online that they will retry the case.

DA Steele announces we will retry this case. — Montgomery County DA (@MontcopaDA) June 17, 2017

William H. Cosby Jr. remains free on bail. New trial date will be set. — Montgomery County DA (@MontcopaDA) June 17, 2017

The decision by O’Neill to end the legal purgatory could see D.A. Kevin Steele’s office seek an entirely new trial before the end of summer. Steele has four months to decide how he wants to pursue a new trial with a new jury for the current three felony charges of second-degree aggravated indecent assault or new ones. On June 16 in court, after a question from the jury, O’Neill made sure that Cosby understood he could be tried again if a mistrial was declared – the actor said he understood.

With that, D.A. Steele will likely want to find out what exactly led to the hung jury of seven men and five women. Even after saying he will seek a retrial, the D.A. could still also decide that another kick at the case in the Philadelphia suburb could result in a similar outcome or even a not guilty verdict, and withdraw the charges for good.

Either way, today’s mistrial doesn’t come as a total surprise. After hours locked away debating the merits of the case, the wind was blowing in that direction earlier on June 15 after the jury announced that morning it was in judicial gridlock over the charges that Cosby allegedly raped the then-Temple University employee in January 2004.

Praising their efforts so far, O’Neill on Thursday used his power under what is known as the Spencer Charge in Pennsylvania to send the sequestered jurors back into deliberation in hopes they could reach a consensus. The jurors did go back for nearly two more days and a few more questions of the court, but obviously to no avail in breaking their logjam.

Having charged Cosby in late 2015, just before the Keystone State’s statute of limitations on sex crimes was about to expire, a mistrial is a huge defeat for the office of the Montgomery County D.A. and Steele personally right now, regardless of any future retrial.

“This is a very straightforward case,” Steele told the jury in his June 12 closing argument about the alleged drugging and sexual assault of Constand at Cosby’s Philadelphia-area mansion. “If you have sexual relations with someone when they’re out, when they’re asleep, when they’re unconscious, that’s a crime,” the D.A. said of that January 2004 night in his more than two hours of remarks Monday.

The trio of charges Cosby faced and could face again break down to “penetration, however slight” of Constand without her consent, that penetration happened while Constand was “unconscious or the defendant knows the complainant is unaware that the penetration is occurring,” and giving the victim an intoxicating drug for “the purpose of preventing resistance.”

On the stand for nearly 10 hours on June 6-7, Constand recollected in sometimes graphic detail what happened in Cosby’s home, the “mentor” relationship she thought she had with the actor beforehand, his previous passes at her, and the aftermath of the alleged assault. Constand’s appearance as a witness was the first time Cosby’s 44-year-old accuser had publicly told her side of events that allegedly transpired at the actor’s mansion more than 13 years ago. Throughout the entire trial on the third floor of the Montgomery County courthouse, Cosby sat at the front at the defense table listening to the proceedings.

Resting their case in the June 5-starting trial less in than 10 minutes Monday, the defense decided not to call Cosby as witness in the only criminal case against the actor, even though more than 60 women have claimed he drugged and sexually assaulted them over the decades. Although the defense’s case was short, Cosby attorney Brian McMonagle gave a more than two-hour-long closing argument that saw his vocal volume go way up and chairs pounded often to punctuate his points about inconsistencies in Constand’s version of the events.

While admitting in an explosive unsealed deposition in Constand’s 2005 civil case that he had Quaaludes to give to women for sex before, and that he gave the then-Temple basketball staffer at least two Benadryl supposedly for stress, Cosby has always insisted the incident in question was consensual.

Never really reaching the proportions of the O.J. Simpson trial that once seemed a fair comparison, Cosby’s criminal trial also came as several civil cases against the actor still pending nationwide, like ex-America’s Next Top Model judge Janice Dickinson’s defamation action in Los Angeles.

As for the Pennsylvania trial, the decision by then-Montgomery County D.A Bruce Castor to not prosecute a criminal case in 2005 was left unclear and unexplored by both sides during the proceedings, a likely confusing factor for the jury. Add to that the convoluted nature of how Constand’s case was resurrected by former Montgomery County D.A. Risa Ferman in mid-2015 when Cosby’s much-leaked 2005 deposition officially made public by a federal judge, and you have a foggy legal timeline.

On top of that, and certainly the big button the defense pushed again and again during the trial, were those apparent inconsistencies in Constand’s version of what happened that 2004 night.

Exposing lapses or contradictions in Constand’s statements and her nearly 10-hour testimony on the stand last week, the defense was stymied in calling a former Constand acquaintance as a witness to supposedly reveal Constand’s motives in accusing Cosby. However, throughout the trial and in their closing argument, the defense centered on the admittedly close relationship Constand said she had with Cosby, how she finally got in touch with police more than a year later, and why she delayed in reporting the alleged rape.

Since going into deliberations Monday, the jury sought clarification on several separate occasions. The first time was on June 12, when the jurors wanted context around how Cosby referred to the Benadryl pills he gave Constand; the judge read to them the portion of the actor’s deposition from the 2005 civil case where Cosby called the pills “little friends.” Almost first thing on Thursday, the jury sought to look over police statements Constand made in 2005 and was read to again from Cosby’s 2005 deposition. That day the jurors heard from Judge O’Neill for about 45 minutes as he read the portions of the deposition centering on the night in question and the sequence of events.

Later on Tuesday, the jurors had another question of clarification, wanting to know what the phrase “without the knowledge” meant. O’Neill responded he couldn’t define the phrase for them. The third felony count that Cosby is charged with addresses the pills, identified in the trial as Benadryl, that the actor gave to Constand. Constand and prosecutors claim the pills left her unable “to fight him” as Cosby allegedly molested her.

On Tuesday afternoon, the jury asked to hear once again the testimony of Detective David Mason, the Toronto-area police officer who took Constand’s first statement in the matter in early 2005, soon after she told her family of the incident.

In their telling fifth question since deliberations began, the jurors Wednsday asked to have specific portions of Constand’s extensive testimony from last week read back to them. In total, Constand’s almost 10 hours of testimony runs to 300 pages, as O’Neill pointed out to the jury. He read aloud for about 30 minutes before the jury exited for more deliberations.

Well over the point of 20 hours of deliberation, the jurors had another question later on Wednesday, wanting to hear the testimony of Cheltenham Township County police Sgt. Richard Schaffer and his initial interview with Cosby in 2005 in New York after Constand and her family contacted Pennsylvania authorities about the alleged assault. Unfortunately, the transcript of that testimony wasn’t ready, so the jury took an early dinner break while the material was prepared by court officials. They eventually heard the testimony late on June 14.

Having announced that they were deadlocked and being sent back to keep trying on June 15, the jury didn’t have any questions on Thursday. However, within less than an hour of starting their deliberations today, the jury had a two-part seventh question that revealed just how fraught things had become. They wanted a definition for “reasonable doubt” and they wanted to re-hear the portion of Cosby’s deposition from Constand’s 2005 civil case against the comedian where he talked about giving Quaaludes to women he was having sex with.

Later on Friday, the jurors asked to hear part of the testimony of Constand’s mother Gianna from last week as well as look over Constand’s phone records in the months right after the alleged assault by Cosby in early 2004. There was also another testy back and forth between the Judge and attorney McMonagle over the latter’s latest unsuccessful attempt to get a mistrial declared. The Judge declined that move by the defense but even after bringing the jury back to deliberate on a Saturday could not get a verdict.

In the days and weeks to come, whether those questions proved to be the stumbling blocks that the jury could not get over will be analyzed over and over. However, sitting in that courtroom during the trial, it was clear that what Constand did, how she did it, and how many lawyers she spoke to was the defense’s primary tactic. It is also clear that the impact of those tactics on the jurors was at least enough to raise the specter of reasonable doubt, put them at a impasse and ultimately cause a mistrial.