Andrea Constand testified that Cosby drugged and sexually assaulted her at his Pennsylvania home in 2004.

Cosby has said he only gave Constand Benadryl and that the incident was consensual.

Dozens of women have accused Cosby of sexual misconduct. This was the first time he was criminally charged. While the statute of limitations ran out in many of those cases, some have sued him in civil court.

Constand sued Cosby in civil court in 2005. During a deposition, Cosby admitted to getting prescriptions for quaaludes and that he planned to give them to women he wanted to have sex with.

His attorneys tried to prevent Cosby's admission from being used against him in the criminal case. They argued Cosby gave that testimony with the understanding that he wouldn't face criminal charges. But in December 2016, a judge ruled the deposition could be used as evidence in the criminal case.

In April 2017, the same judge ruled that jurors could hear Cosby's testimony regarding quaaludes.

However, he also ruled in Cosby's favor, stating neither the prosecution nor the defense could "make any reference to any civil suit or the settlement thereof."

It will now be up to prosecutors to decide whether they want to retry the case.