Andrea Constand did not break her confidential settlement agreement with Bill Cosby by cooperating with detectives in an investigation that led to criminal charges against the entertainer, a federal judge has ruled.

The ruling, by District Judge Eduardo C. Robreno, dismissed portions of Cosby's bid to make Constand return the money he paid her a decade ago to settle sexual-assault claims.

Cosby contended that the agreement prevented any party from disclosing details about the lawsuit or a 2005 criminal investigation into the allegations.

But a provision preventing someone from voluntarily sharing information about crimes with law enforcement would be "unenforceable," Robreno wrote in the ruling, made public Monday.

Constand first reported the alleged assault to police in 2005, saying Cosby had drugged and molested her in his Cheltenham home. After then-Montgomery County District Attorney Bruce L. Castor Jr. declined to file charges, Constand sued Cosby. The suit was settled out of court in 2006, and its details, including how much Cosby paid Constand, have never been made public.

Montgomery County prosecutors reopened the investigation last summer, after excerpts of a deposition Cosby gave in Constand's suit were made public, and dozens of women came forward with similar allegations. Cosby has repeatedly denied all allegations against him.

He sued Constand, her attorneys, and her mother in February and demanded the return of his settlement money, contending they broke the settlement agreement by cooperating with law enforcement. On Monday, Robreno dismissed Constand's mother from the suit, and the claims against Constand and her attorneys that related to their cooperation with the criminal investigation.

Robreno did not dismiss claims that Constand's attorneys violated the settlement through alleged involvement in a court reporter's release of the full transcript of Cosby's deposition to the media last summer, or by writing an open letter to Castor last year that criticized his handling of the 2005 investigation.

Robreno also did not dismiss Cosby's claim that Constand violated the confidentiality agreement by giving an interview to the Toronto Sun or by posting a tweet that said "I won't go away, there is a lot more I will say."

But given that the case is proceeding, Cosby's attorneys on Monday issued a statement saying they were "very pleased with the ruling in favor of our client, which means that this case will be decided where it should be - in a court of law and on a full factual record."

Cosby, 79, has been ordered to stand trial in Montgomery County on charges of aggravated indecent assault and has pleaded not guilty. If convicted, he faces five to 10 years in prison. A pretrial conference before Judge Steven T. O'Neill is scheduled for September.

610-313-8116 @Lmccrystal