Bill Cosby testified that he gave powerful sedatives to a 19-year-old woman in 1976 before the two had what he described as consensual sex, according to court filings unsealed Monday from a 2005 lawsuit.

The now-77-year-old actor-comedian said under oath that he had obtained seven prescriptions for Quaaludes, a depressant, with the intent to use them in sexual encounters with women.

He later said he gave them to only the 19-year-old, whom he met backstage at a Las Vegas comedy show. He maintained that the woman knew what drugs she was taking.

"I give her Quaaludes. We then have sex," Cosby said.

The statement was made during a deposition as part of a 2005 lawsuit from another Cosby accuser, former Temple University employee Andrea Constand. She alleged that Cosby groped her at his Cheltenham mansion in 2004.

Cosby's deposition was unsealed Monday by a federal court in Philadelphia over objections from Cosby's lawyers.

The court challenge was brought by the Associated Press nearly 10 years after the deposition. It was prompted by more recent accusations of sexual assault from more than two dozen women, many of whom say they were drugged and sexually assaulted in incidents dating back four decades.

Cosby has denied the allegations. He has never faced criminal charges. His lawyers did not respond to calls for comment late Monday.

In siding with the news organization, U.S. District Judge Eduardo Robreno said the entertainer's past outspokenness on issues such as child rearing, family life, education, and crime had diminished his expectation of privacy. "The stark contrast between Bill Cosby, the public moralist, and Bill Cosby, the subject of serious allegations concerning improper (and perhaps criminal) conduct, is a matter as to which the . . . public . . . has a significant interest."

According to portions of the deposition quoted in the unsealed filings, Constand's lawyer, Dolores M. Troiani, pressed Cosby in 2005 on his use of drugs in sexual encounters.

Her client had accused Cosby of giving her sedatives after she had gone to his house for career advice. Cosby maintained the pills were Benadryl.

He testified, however, that he had obtained seven Quaalude prescriptions in the 1970s.

"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?" Troiani asked.

Cosby responded, "Yes." Later, he said he had misunderstood the question and was only referring to one instance.

Troiani later asked whether Cosby had ever given Quaaludes to women without their knowledge. His lawyer objected, and Cosby did not answer.

Cosby settled the lawsuit with Constand in 2006. The terms remain undisclosed.

In a statement to ABC News late Monday night, representatives for Cosby said: "The only reason Mr. Cosby settled was because it would have been embarrassing in those days to put all those women on the stand and his family had no clue. That would have been very hurtful."

215-854-2608 @jeremyrroebuck