NORRISTOWN, Pa. (Reuters) - Pennsylvania prosecutors vowed to retry comedian Bill Cosby on sexual assault charges after a jury on Saturday failed to render a unanimous verdict despite 52 hours of deliberations in a case that echoed accusations made by dozens of women against him.

Judge Steven O’Neill, of the Montgomery County Court of Common Pleas, declared a mistrial on Saturday morning following a note from jurors saying that they were hopelessly deadlocked on three counts of aggravated sexual assault.

The result was a victory for Cosby, 79, who had faced years in prison for allegedly drugging and sexually assaulting college administrator Andrea Constand at his home near Philadelphia in 2004. But prosecutors immediately said they would seek a second trial, which O’Neill suggested could start within four months.

“She’s entitled to a verdict in this case,” Montgomery County District Attorney Kevin Steele said at a news conference.

Cosby’s spokesman, Andrew Wyatt, told reporters that the trial’s outcome had “restored” his client’s legacy.

But Cosby’s reputation remains in tatters, following a slew of sexual assault allegations from about 60 women that have destroyed the “America’s dad” image he built as star of the long-running 1980s TV comedy “The Cosby Show.”

Constand’s claim was the only one to lead to criminal charges, with many of the others dating too far back to allow for prosecution.

The entertainer had no visible reaction in court. As news reporters streamed out of the room, several other Cosby accusers, some in tears, waited in line to hug Constand, who smiled broadly and maintained her composure.

‘YOU’RE NOT OFF THE HOOK’

Outside the courthouse, as Cosby stood silently behind them, members of his team criticized the case against him.

“This is what happens - juries are stuck when a prosecutor seeks to put someone in prison for things that are simply not presented in the courtroom,” said Angela Agrusa, one of Cosby’s lawyers.

Slideshow ( 21 images )

In a statement read aloud by one of Cosby’s aides, his wife, Camille, who attended only a couple of hours of the trial, took aim at the prosecutors and the judge.

“How do I describe the district attorney? Heinously and exploitatively ambitious,” Camille Cosby said in the statement. “How do I describe the judge? Overtly arrogant and collaborating with the district attorney.”

The mistrial was a blow to the dozens of women who have said they were sexually assaulted by Cosby, including several who attended the trial wearing buttons that read “We Stand in Truth.”

Victoria Valentino, a former Playboy model who has accused Cosby of drugging and raping her decades ago, had a message for him. “You’re not off the hook, buddy,” she said outside the courtroom.

Constand did not speak to reporters, but her attorney, Dolores Troiani, said Constand was a “very spiritual person who believes everything happens for a reason.”

Cosby has denied all of the women’s claims, saying that any sexual encounters were consensual. He still faces several civil lawsuits from at least 10 accusers.

Cosby’s starring role as beloved dad Heathcliff Huxtable in “The Cosby Show,” along with years of family-friendly standup comedy routines, made him a household name. He became an in-demand product endorser, appearing in commercials for Jell-O, Coca-Cola and Ford.

He co-starred in the 1960s espionage show “I Spy,” the first black performer to star in a weekly American TV dramatic series.

But his live performing career stalled in 2015, as multiple accusers began going public with their stories.

Slideshow ( 21 images )

JURORS REVISITED TESTIMONY

In Norristown, Pennsylvania, the jury struggled for days to agree on which version of the night in question to believe: Constand’s or Cosby’s.

Constand, then 31, met the married Cosby 15 years ago through her job as an administrator with the women’s basketball team at Temple University in Philadelphia, where Cosby was a trustee and the school’s most renowned alumnus.

She testified that Cosby acted as a mentor before offering her unidentified pills one night that left her unable to stop his advances.

Cosby’s defense lawyers, however, argued that Constand’s account could not be trusted after they pointed to numerous discrepancies in her statements to police in 2005, when she first reported the encounter, which occurred nearly a year earlier.

In more than a dozen notes to the judge, the jurors asked to revisit huge chunks of trial testimony, including Constand’s account from the witness stand, her statements to police from 2005 and Cosby’s sworn depositions taken in 2005 and 2006, when Constand filed a civil lawsuit against him.

Cosby chose not to testify at the trial.

By Thursday morning, after nearly 30 hours of discussions spanning three days, the jurors told O’Neill they were at a stalemate. The judge instructed them to keep working, but despite marathon 12-hour sessions, the jury said on Saturday it was at an impasse.

The trial drew intense media attention, with more than 100 credentials issued for print, online, television and radio reporters.

The case itself has followed a long path to prosecution. In 2005, prosecutors declined to charge Cosby based on Constand’s account, and she filed a lawsuit that Cosby settled for an undisclosed sum.

His depositions in that case, however, were unsealed by a federal judge in 2015, revealing his admissions that he had given sedatives to young women in the 1970s and prompting prosecutors to reopen the case.

He was eventually charged in December 2015, just days before the statute of limitations was set to expire.

Although the district attorney has vowed to try the case again, Steele may have difficulty in winning an eventual conviction, according to former prosecutors and defense lawyers. Cosby’s legal team has now seen the prosecution’s whole case and can home in on inconsistencies the second time around, they say.