NORRISTOWN, Pa. — Prosecutors in Bill Cosby’s sex assault trial closed their case Friday, ending five days of evidence and testimony by letting jurors hear the 79-year-old entertainer’s admission that he used to get Quaaludes, a powerful sedative, to use in sexual encounters with women.

In a 2005 deposition, Cosby admitted to obtaining seven prescriptions for the disco-era party drug from a Hollywood gynecologist in the ’70s.

But he insisted that he had never given anyone pills without their knowledge and consent.

“Quaaludes happen to be the drug that … young people were using to party with, and I wanted to have them just in case,” Cosby said, according to the testimony read into the record.

The excerpts were part of a prosecution bid to leave a lasting impression on the jury of seven men and five women in a case that has centered around questions of whether the celebrity administered a powerful sedative to his accuser, Andrea Constand.

They capped a five-day presentation in Norristown highlighted by Constand’s testimony on the witness stand and several potentially damaging admissions from Cosby himself, picked from the deposition he gave for a lawsuit she filed against him in 2005.

As Cosby walked from the courtroom, a woman yelled: “Bill Cosby, I love you!”

Cosby raised his walking stick in acknowledgment.

Montgomery County District Attorney Kevin R. Steele has cited a 2015 ruling by a federal judge in Philadelphia to unseal excerpts of that testimony as an impetus for his office’s decision to reopen the Constand investigation after a decade.

Charged with three counts of aggravated indecent assault, the comedian could face more than a decade in prison if convicted.