Bill Cosby’s damning admission in a civil lawsuit that he gave women drugs before having sex with them can be used as evidence at his criminal trial, a Pennsylvania judge ruled Monday.

The ruling is a blow to the once-beloved comedian’s defense, as he fights charges that he sexually assaulted former Temple University employee Andrea Constand.

Cosby admitted to giving women Quaaludes in a 2005 deposition for Constand’s civil case, after then-DA Bruce Castor promised not to criminally prosecute the comic.

“When you got the Quaaludes, was it in your mind that you were going to use these Quaaludes for young women that you wanted to have sex with?” Constand’s then-lawyer, Dolores Troiani, asked Cosby in 2005.

“Yes,” Cosby replied.

Cosby described in the deposition how he put his hands down Constand’s pants because he didn’t hear her tell him to stop.

“I don’t hear her say anything. And I don’t feel her say anything. And so I continue and I go into the area that is somewhere between permission and rejection. I am not stopped,” he said.

Cosby, now 79, said he would have sex with the women he fed drugs, but that the encounters were all consensual. Cosby, however, has been accused by dozens of women of drugging and raping them.

He now contends he gave Constand only a dose of Benadryl during their 2004 encounter at his Pennsylvania home.

The defense has always insisted Cosby agreed to answer Constand’s civil-lawsuit questions only after Castor promised not to prosecute.