Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

The sexual assault case against legendary comedian Bill Cosby will go to trial, a judge decided Tuesday, after finding enough evidence in a preliminary hearing to proceed.

Montgomery County, Pennsylvania, District Judge Elizabeth McHugh found probable cause after portions of the police statement from accuser Andrea Constand were read in court. Constand was not required to testify and was not in court.

Cosby, 78, faces up to 10 years in prison if convicted. The judge's decision marks a stunning turn of events for the once-beloved sitcom star, who thus far had avoided trial.

His defense team had argued the case — the only criminal case amid dozens of accusations — shouldn't be tried.

Related: How Hard Will It Be to Convict Bill Cosby?

At issue is "an accusation made many years ago about an incident that allegedly occurred 12 years ago," Cosby's defense attorney Brian McMonagle said Tuesday. "I have never once had a case where the prosecution has relied, in a sexual abuse case, on exclusively hearsay evidence in a hearing."

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

"It is a complete denial of this defendant's due process rights," McMonagle added.

The formal arraignment, which Cosby waived, is scheduled to take place on July 20.

Related: Cosby's Wife Defends Comedian in Unsealed Deposition

Constand, a former basketball star who worked at Cosby's alma mater, Temple University, claims that he drugged and molested her at his nearby Pennsylvania home in 2004. Cosby insists their sexual encounter was consensual.

Prosecutors at the time chose not to charge Cosby, but he was hit with a count of aggravated indecent assault last year after dozens of other women came forward with claims of sexual misconduct.

Bill Cosby arrives at the Montgomery County Courthouse for a preliminary hearing in Norristown, Pa., on May 24. Tracie Van Auken / EPA

Katherine Hart, a former Montgomery County detective who interviewed Constand at the time of the allegations, read the police statement Constand filed at the time, in which she described being invited to Cosby's Cheltenham Township house.

At one point, according to the statement, Constand went to bathroom and came back to find Cosby had poured her a glass of wine. He also allegedly handed her three pills and urged her to take them.

"I started to have blurred vision," the statement said. "I got scared, I thought I was having a bad reaction to something, I had no strength in my legs."

As Constand floated in and out of consciousness, Cosby assaulted her, the statement said.

Cosby has denied all allegations of assault and has sued some of his accusers for defamation. He settled a lawsuit by Constand for an undisclosed sum a decade ago.

Related: Lurid Celebrity Trials: Cosby Destined to Join List

Gloria Allred, who represents more than 30 clients who have also accused Cosby — including Judy Heff, who has a civil lawsuit against him — attended Tuesday's hearing and called it "very fair."

I think it's an important day and I'm looking forward to the trial," she told reporters afterwards.

Cosby entered the Pennsylvania courtroom Tuesday dressed in a dark suit, white shirt and a tie, and walked in with the help of an assistant, cracking a few smiles, and showed little reaction when the judge said he would be tried on all charges.

Cosby has been free on $1 million bail since he was arrested Dec. 30.