Bill Cosby Will Face Trial on Sex Assault Charges After Judge Refuses to Throw Out Case

A Pennsylvania judge refused Wednesday to throw out sexual assault charges against Bill Cosby, meaning the comedian will go on trial.

A Pennsylvania judge refused Wednesday to throw out sexual assault charges against Bill Cosby, meaning the criminal case against the comedian will proceed.

The next step is a preliminary hearing to determine whether prosecutors have sufficient evidence to prove Cosby attacked his accuser.

Read: Beverly Johnson Reacts to Bill Cosby Deposition: 'I Wasn't Surprised. It Is Sad.'

The judge rejected Cosby's lawyer's argument that the district attorney at the time of the alleged assault said the comedian would never be prosecuted.

“A secret agreement that permits a wealthy defendant to buy his way out of a criminal case isn’t right,” Montgomery County District Attorney Kevin Steele said Wednesday, USA Today reported.

Cosby, 78, is charged with three counts of aggravated indecent assault for a 2004 sexual encounter with Andrea Constand, a former Temple University basketball staffer.

His attorney, Brian Monagle, called former prosecutor Bruce Castor to the stand Tuesday and questioned him about his decision to not file charges against Cosby at the time of the alleged attack.

Castor testified that Constand had "credibility issues" and would fare better if she filed a civil suit against Cosby.

Read: Bill Cosby's Accusers Subpoena His Wife Camille 

The former prosecutor said his case lacked physical evidence against the comedian and that the alleged victim had undermined her credibility by first contacting an attorney before reporting the incident to police.

"I decided that there was insufficient credible evidence on which any charge related to Mr. Cosby as alleged by Ms. Constand could be proven beyond a reasonable doubt," Castor said.

"I did not believe it was just to go forward with a criminal prosecution but I wanted there to be some determination of justice," he said, according to NBC News.

Cosby, who is free on $1 million bail, has denied all wrongdoing and has filed defamation suits against seven of his accusers. 

Watch: Bill Cosby in Court, Lawyers Try to Get Charges for Sexual Assault Dropped