Using a cane, the 78-year-old comedian walked slowly and unsteadily into court on the arms of his lawyers to answer charges he drugged and sexually assaulted a woman less than half his age at his suburban Philadelphia home in 2004. He and his attorneys had no comment as he was released on $1 million bail.
The case marks the first time Cosby has been charged with sexual misconduct despite years of lurid allegations, and sets the stage for perhaps the biggest Hollywood celebrity trial of the mobile-news era.
The former "Cosby Show" star and celebrated breaker of TV's racial barriers was charged with aggravated indecent assault, punishable by five to 10 years in prison and a $25,000 fine. He did not have to enter a plea at his court appearance.
The decision to prosecute him came down just days before Pennsylvania's 12-year statute of limitations for bringing charges was set to run out.
Prosecutors accused Cosby of plying former Temple University employee Andrea Constand with pills and wine, then penetrating her with his fingers without her consent, while she was drifting in and out of consciousness, unable to resist or cry out.
She was "frozen, paralyzed, unable to move," Montgomery County District Attorney-elect Kevin Steele said. In court papers, prosecutors said the drugs were the cold medicine Benadryl or some other, unidentified substance. Steele noted that Cosby has admitted giving quaaludes to women he wanted to have sex with.
Cosby acknowledged under oath a decade ago that he had sexual contact with Constand but said it was consensual.
Wearing a black-and-white hooded sweater into court, Cosby seemed to have trouble seeing the paperwork and finding the place to sign, and his lawyers helped him hold the pen. But he seemed at ease, laughing and chatting with his attorneys.
When the judge said, "Good luck, Mr. Cosby," he shouted: "Thank you!"
The case represents an about-face by the district attorney's office, which under a previous DA declined to charge Cosby in 2005 when Constand first told police that the comic violated her by putting his hands down her pants at his home in Cheltenham.
Prosecutors reopened the case over the summer as damaging testimony was unsealed in Constand's related civil lawsuit against Cosby and as dozens of other women came forward with similar accusations that destroyed his good-guy image as America's Dad.
"Reopening this case was not a question. Rather, reopening this case was our duty as law enforcement officers," said Steele, a top deputy in the DA's office who will take over in January.
In court papers, prosecutors said there are probably other women who were similarly drugged and violated by Cosby. Steele urged them to come forward.
Constand, now 42, lives in Toronto and works as a massage therapist. Her attorney, Dolores Troiani, welcomed the charges.
"She feels that they believe her, and to any victim, that is foremost in your mind: Are people going to believe me," Troiani said. The attorney added: "Naturally it is troubling that it took until the eleventh hour for this day to arrive. She is hopeful that her patience has encouraged other victims to come forward."
The case adds to the towering list of legal problems facing the TV star, including defamation and sexual-abuse lawsuits filed in Massachusetts, Los Angeles and Pennsylvania.
The statute of limitations for bringing criminal charges against him in other places has run out in nearly every case. One exception is a 2008 case still under investigation in Los Angeles.
A key question if the case goes to trial is whether the judge will allow supporting testimony from some of those other accusers to show a pattern of "bad acts." The judge could decide such testimony would be unfair to Cosby.
Cosby in 1965 became the first black actor to land a leading role in a network drama, "I Spy," and he went on to earn three straight Emmys. Over the next three decades, the Philadelphia-born comic created TV's animated "Fat Albert" and the top-rated "Cosby Show," the 1980s sitcom celebrated as groundbreaking television for its depiction of a warm and loving black family headed by two professionals, one a lawyer, the other a doctor.
He was a fatherly figure off camera as well, serving as a public moralist and public scold, urging young people to pull up their saggy pants and start acting responsibly.
Constand, who worked for the women's basketball team at Temple, where Cosby was a trustee and proud alumnus, said she was assaulted after going to his home in January 2004 for some career advice.
Then-District Attorney Bruce Castor declined to charge Cosby, saying at the time that the comedian and his accuser could be portrayed in "a less than flattering light." Constand eventually settled a lawsuit against Cosby in 2006 on confidential terms.
Her allegations and similar ones from other women in the years that followed did not receive wide attention at the time but exploded into view in late 2014, first online, then in the wider media, after comedian Hannibal Buress mocked the moralizing Cosby as a hypocrite and called him a rapist during a standup routine.
That opened the floodgates to even more allegations.
The women were mostly from the world of modeling, acting or other entertainment fields, and Cosby or his representatives denied their allegations, accusing some of them of trying to extract money from him or get ahead in show business.
Earlier this year, The Associated Press persuaded a judge to unseal documents from the Constand lawsuit, and they showed the long-married Cosby acknowledging a string of affairs and sexual encounters.
Cosby, a longtime resident of Shelburne Falls, Massachusetts, testified that he obtained quaaludes in the 1970s to give to women "the same as a person would say, 'Have a drink.'" He denied giving women drugs without their knowledge.
In his deposition, Cosby said he gave Constand three half-pills of Benadryl for stress without telling her what they were. He said he groped Constand, taking her silence as a green light.
"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," Cosby testified. He said Constand was not upset when she left.
Prosecutors said Cosby used wine and drugs to render her incapable of resistance after "the much younger, athletic" Constand blocked two previous sexual advances.
Constand's lawyer has said Constand is gay and was dating a woman around the time she met Cosby in the early 2000s.
The AP generally does not identify people who say they have been sexually assaulted unless they agree to have their names published, as Constand has done.
Cosby's fall has been especially painful to many blacks who regarded his commercial and cultural success with great pride.
"There is a fatal difference now between Cliff Huxtable and Bill Cosby that can never be overcome," said author and professor Michael Eric Dyson, who wrote a book on Cosby a decade ago. "It does add a creepy subtext and a shadow of tremendous moral weight that will inevitably be brought up each time his name is evoked."