Bill Cosby admitted in 2005 that he got quaaludes with the intent of giving them to young women he wanted to have sex with, and that he gave another sedative to at least one woman and “other people”, according to documents obtained on Monday by the Associated Press.

That woman and a second woman testified in the same case that they knowingly took quaaludes from him, according to the unsealed documents.

The AP had gone to court to compel the release of the documents from the deposition in a sexual abuse lawsuit filed by former Temple University employee Andrea Constand – the first of a cascade of sexual abuse lawsuits against him. Cosby’s lawyers had objected on the grounds that it would embarrass their client.

Cosby settled that lawsuit under confidential terms in 2006. His lawyers in the Philadelphia case did not immediately return phone calls on Monday. Constand consented to be identified but did not want to comment, her lawyer said on Monday.

Cosby, 77, has been accused by more than two dozen women of sexual misconduct, including allegations by many that he drugged and raped them in incidents dating back more than four decades. Cosby has never been criminally charged, and most of the accusations are barred by statutes of limitations.

Cosby, giving sworn testimony in the lawsuit accusing him of sexual assaulting Constand at his home in Pennsylvania in 2005, said he got seven quaalude prescriptions in the 1970s. The lawyer for Constand asked if he had kept the sedatives through the 1990s – after they were banned – but was frustrated by objections from Cosby’s lawyer.

“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?” lawyer Dolores M Troiani asked.

“Yes,” Cosby answered on 29 September 2005.

“Did you ever give any of these young women the quaaludes without their knowledge?” Troiani asked.

Cosby’s lawyer again objected, leading Troiani to petition the federal judge to force Cosby to cooperate.

Cosby later said he gave Constand three half-pills of Benadryl, although Troiani in the documents voices doubt that was the drug involved. The two other women who testified on Constand’s behalf said they had knowingly been given quaaludes.

Three of the women accusing Cosby of sexually assaulting them have a defamation lawsuit pending against him in Massachusetts. They allege that he defamed them when his agents said their accusations were untrue. Cosby is trying to get their case thrown out before discovery.

Cosby had fought the AP’s efforts to unseal the testimony, with his lawyer arguing the deposition could reveal details of Cosby’s marriage, sex life and prescription drug use.

“It would be terribly embarrassing for this material to come out,” lawyer George M Gowen III argued in June. He said the public should not have access to what Cosby was forced to say as he answered questions under oath from the accuser’s lawyer nearly a decade ago.

“Frankly ... it would embarrass him, [and] it would also prejudice him in eyes of the jury pool in Massachusetts,” Gowen said.

US district judge Eduardo Robreno asked last month why Cosby was fighting the release of his sworn testimony, given that the accusations in the Temple woman’s lawsuit were already in the public eye.

“Why would he be embarrassed by his own version of the facts?” Robreno said.

Cosby resigned in December from the board of trustees at Temple, where he was the popular face of the Philadelphia school in advertisements, fundraising campaigns and commencement speeches.