Bill Cosby's trial over sexual assault allegations has ended in a mistrial after the jury failed to reach a decision.

The jury said they remained "hopelessly deadlocked" for a second time after deliberating for more than 52 hours at the Montgomery County Courthouse.

The comedian was accused of assaulting Andrea Constand after drugging her with pills in January 2004.

Cosby, 79, denied the accusations from Constand, the former director of operations for Temple University's women's basketball team, alleged to have taken place at his home near Philadelphia.

His lawyers argued the encounter between the pair was consensual. The 79-year-old did give evidence at the trial.

Cosby was charged with three counts of aggravated indecent assault. He faced up to 10 years in jail if he was found guilty.

Around 60 women have come forward to accuse Cosby of sexually assault, but the statute of limitations for prosecution had run out in nearly every case. Constand's case is the only one in which Cosby has been charged.

The latest decision from the judge means Cosby could still face yet another trial with a different set of jurors. Prosecutors now have four months to decide whether they want to retry Cosby or drop the charges.

Bill Cosby trial
Bill Cosby was on trial over the alleged sexual assault of Andrea Constand in 2004 Eduardo Munoz Alvarez-Pool/Getty Images