Bill Cosby
Actor and comedian Bill Cosby arrives for the second day of hearings at the Montgomery County Courthouse in Norristown, Pennsylvania, Feb. 3, 2016. REUTERS/Ed Hille/Pool

Bill Cosby's attempts to block a defamation lawsuit against him failed Monday after a Massachusetts judge only partially granted a stay. The ruling comes as Cosby faces a criminal charge of sexual assault in Pennsylvania's Montgomery County stemming from a 2004 case.

"Undoubtedly ... there is a risk — perhaps a significant one — that any incriminating evidence produced by defendant with regard to the events at issue in this case could be admissible in his criminal trial," said U.S. District Judge Mark Mastroianni, according to Hollywood Reporter.

"A complete stay of this litigation, however, is not warranted," he added. Mastroianni said only the discovery addressed to Cosby in the case is stayed, and the motion is allowed in part and denied in part.

He said in the ruling that he was blocking the discovery to avoid Cosby's "Fifth Amendment predicament" of having to choose between asserting his privilege against self-incrimination and putting himself at a disadvantage in the Massachusetts case or waiving that privilege and likely incriminating himself in the Pennsylvania case, the Associated Press reported.

The defamation lawsuit has been filed by Tamara Green, Therese Serignese, Linda Traitz, Barbara Bowman, Joan Tarshis, Louisa Moritz and Angela Leslie who are among 50 women who accused the 78-year-old comedian of sexual misconduct.

Cosby has denied all allegations against him.