O'Neill said he based his ruling on "court filings, exhibits and testimony" with the credibility determination of former Montgomery County District Attorney Bruce L. Castor, Jr. being "an inherent part of this court's ruling."
The judge also denied a motion by Cosby's team to remove newly elected Montgomery County District Attorney Kevin Steele as the prosecutor for the case.
Castor had no immediate reaction to the ruling. Cosby's attorneys declined to comment after the decision. Cosby is facing an aggravated indecent assault for allegedly drugging and sexually assaulting former Temple employee Andrea Constand, now 42, at his Elkins Park, Pennsylvania home in January 2004.
Dolores Troiani, one of Constand's attorneys, said they were pleased with the decision.
Kena Betancur / AFP / Getty
"Obviously Andrea was very upset yesterday with the manner in which Castor testified about her," Troiani tells PEOPLE. "We feel very vindicated and are convinced now that justice will prevail in a Montgomery County courtroom."
Castor testified for nearly seven hours Tuesday, saying in February 2005 he promised not to prosecute Cosby – ever – if he did not invoke his 5th amendment rights not to incriminate himself in a not-yet filed civil suit.
He said Constand's attorneys signed off on the agreement in 2005. On Wednesday, however, both of Constand's attorneys testified that was not true. They said they found out he decided not to prosecute Cosby when the press showed up at their door.
They also blasted Castor for the way he treated their client back then and said when Steele came to them last summer and asked if Andrea would cooperate in a criminal investigation they weren't sure at first.
Steele, who was the county's first assistant district attorney at the time, came to her office last July and said "they were going to reopen the investigation provided my client was willing to cooperate," Troiani testified.
Kena Betancur / AFP / Getty
He asked "if my client had the stamina to do this again," Troiani said. "And you have to understand what happened with Mr. Castor, that was a major issue. He slandered her. She's a victim of a sexual assault. I was the first woman in Chester county to try a sexual assault case and I had a judge telling me I had to find a better word for penis…and 30 years later we have a district attorney slamming a victim.
"My client was deeply hurt by the manner in which she had been treated by district attorney Castor," she said. "She did not understand why he had to slam her and frankly we don't understand why he didn't prosecute. Obviously that left a very bitter taste in her mouth. It was also very traumatic to her and her family."
Constand has filed a defamation suit against Castor, claiming he libeled her with comments he made to the press about her last year. Castor has denied these allegations.
Troiani and her former law partner Bebe Kivitz also described Cosby's four days of deposition testimony as "extremely contentious" and said he even walked out at one point.
"There was a lot of yelling and screaming," Troiani said.
Cosby's attorneys refused to allow him to answer questions about the alleged incident that occurred between he and Constand so they had to file a motion to compel his cooperation, which the judge granted. The preliminary hearing is scheduled for March 8.