In a ruling sure to bring relief to those who have watched as more than 50 women have accused him of sexual assault, a Philadelphia-area judge ruled Wednesday that he would not honor an informal agreement not to prosecute Bill Cosby made a decade ago, and refused to dismiss an indecent assault case against him.

Cosby, 78, was charged last December by Montgomery County assistant prosecutor Attorney Kevin Steele.

Bruce Castor, a former Montgomery County District Attorney, testified yesterday why he didn’t charge Cosby when the alleged incident happened more than 10 years ago.

The argument revolved around an oral agreement between Castor and Cosby’s attorney in which Cosby agreed to give a deposition in a civil suit brought by the alleged victim in 2005. In that deposition, he admitted giving Quaaludes to another woman, and three half-tablets of Benedryl to Constand.

The former D.A. said he believed Constand told the truth but waited too long to come forward.

Andrea Constand was a Temple University employee who said the comedian invited her to his home in 2004 and made unwanted sexual advances. She described him giving her pills and wine, which left her unable to move. At that point, she said, Cosby indecently assaulted her.

Dozens of local residents outside the courthouse cheered him on as the star made his way to the courthouse, some yelling, “We love you, Bill!”

The next step is a preliminary hearing scheduled for March 8, when the judge will decide whether there is enough evidence to hold Cosby for trial.