Updated

Damaging testimony that Bill Cosby gave in an accuser's lawsuit, including admissions that he gave young women drugs and alcohol before sex, can be used at his sex assault trial, a judge ruled Monday.

The defense has insisted that Cosby testified only after being promised he would never be charged over his 2004 encounter with accuser Andrea Constand. But his lawyers at the time never had an immunity agreement or put anything in writing.

"This court concludes that there was neither an agreement nor a promise not to prosecute, only an exercise of prosecutorial discretion," Montgomery County Judge Steven O'Neill wrote in his ruling.

Cosby, 79, acknowledged in the 2006 deposition that he had a string of extramarital relationships. He called them consensual, but many of the women say they were drugged and molested. The release of the deposition testimony last year prompted prosecutors to reopen Constand's 2005 police complaint.

Cosby, asked about the 2004 encounter at his home with Constand, described being on his couch and putting his hand down her pants.

"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 in his deposition testimony.

Prosecutors describe Constand as being semiconscious after Cosby gave her three unmarked blue pills for stress.

The ruling on the deposition is one of two key pretrial issues that will determine the scope of the evidence against Cosby at trial.

The other question is how many other accusers will be allowed to testify in prosecutors' attempt to show a pattern of similar conduct. Prosecutors hope to call 13 additional women who say they were assaulted by Cosby as far back as the 1960s. Two days of arguments on that issue are set for next week.

In court arguments this year, O'Neill has said that Cosby's decision to testify at the deposition could have been strategic. The actor -- known as America's Dad for his top-rated family sitcom, "The Cosby Show," which ran from 1984 to 1992 -- could have invoked his Fifth Amendment right not to incriminate himself. But jurors would have heard of that decision if the case went to trial.

Cosby instead settled Constand's lawsuit, for an undisclosed amount, after finishing four days of testimony about his extramarital affairs, his friendship with Constand and other topics.

In another excerpt, Cosby described a phone call with Constand's mother a year later, when he refused to say what the pills were.

"I'm not going to argue with somebody's mother who is accusing me of something," he testified. "And I'm apologizing because I'm thinking this is a dirty old man with a young girl. I apologized. I said to the mother it was digital penetration."

Cosby also described getting seven prescriptions for quaaludes in the 1970s, which he said he kept on hand to give women he hoped to seduce, "the same as a person would say, `Have a drink."'

Constand had met Cosby at Temple University when she managed the women's basketball team. He was a prominent booster and university trustee. She went to police in 2005 to report that he had sexually assaulted after taking what Cosby described as an herbal product. Constand, then 30, was dating a woman at the time and had no romantic interest in the 66-year-old Cosby, her lawyer has said.

District Attorney Kevin Steele called the ruling on the deposition an important development in the 12-year-old case.

"Allowing the jury to hear Mr. Cosby's deposition testimony is another step forward in this case and will aid the jury in making its determination. It's important that we are able to present all of the evidence available," Steele said.

Defense lawyer Brian McMonagle had no comment on the decision.

The defense will fight strenuously to block the testimony of the other women, arguing that their accounts are vague, decades old and impossible to defend. Cosby's lawyers had hoped to question the women in person to assess their credibility and relevance, but O'Neill rejected the idea.

Defense lawyers also say Cosby is legally blind and can no longer recognize his accusers or help them prepare for trial.

The Associated Press does not typically name people who say they are sexual assault victims, but Constand has given permission for her name to be used.