By Dan Whitcomb

(Reuters) - A federal judge has thrown out parts of a lawsuit filed by disgraced comedian Bill Cosby against one of his accusers, her mother, two lawyers and the publisher of the National Enquirer claiming that they violated a confidential settlement agreement.U.S. District Judge Eduardo Robreno, ruling on motions by the defendants to dismiss the case, said that Cosby could not sue Andrea Constand, her mother or attorneys for speaking to investigators about her accusations.

But Robreno let stand, for now, Cosby's other claims, including that Constand, a former Temple University basketball coach, violated the confidentiality agreement through posts she made on twitter about the case and in comments to the Toronto Sun newspaper.

The judge said Cosby could sue Constand lawyers Dolores Troiani and Bebe Kovitz for an open letter they wrote about the case published in the Philadelphia Enquirer.

And the comic can also proceed with his claims against American Media, Inc., over articles it published about the case, Robreno said in the ruling, which was issued on Friday.

"While we are of course very pleased with the court's 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 - we will not comment further on the record," Cosby spokesman Andrew Wyatt said.

Once one of the most beloved U.S. entertainers thanks to his family-friendly persona, Cosby, 78, is facing accusations of sexual assault from dozens of women stretching back decades. Most of the other claims involve incidents that are too old to produce charges.

Constand's allegations, that he drugged and sexually assaulted Constand at his Pennsylvania home in 2006, are also the basis for the only criminal prosecution against him.

Cosby earlier this year sued Constand, her mother, two of her attorneys and American Media Inc., publisher of the National Enquirer, claiming that they had violated the terms of a 2006 confidential settlement agreement.

That pact stemmed from a lawsuit Constand filed against Cosby the previous year over the alleged assault and a separate legal action she took against the National Enquirer for defamation.

(Reporting by Dan Whitcomb; Editing by Chris Reese)