Holding 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 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.
"Make no mistake: We intend to mount a vigorous defense against this unjustified charge, and we expect that Mr. Cosby will be exonerated by a court of law," his attorney Monique Pressley said in a statement.
The decision to prosecute came just days before Pennsylvania's 12-year statute of limitations for bringing charges was set to run out. It represents an about-face by the district attorney's office, which under a previous DA declined to charge Cosby in 2005 when the woman first told police that the comic put his hands down her pants.
The former "Cosby Show" star and breaker of 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.
"It's sad for his legal team, for his family that he would be dragged through this, that this would be a political maneuver, that this would be a fulfillment of a campaign promise as opposed to something that is necessary for justice," Pressley said Wednesday night.
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.
"We are 12 years in, 12 years after an alleged assault that was fully investigated," Pressley said.
Wearing a black-and-white hooded sweater, Cosby tripped on a curb as he made his way into court. Inside, he 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 to you, sir," he shouted: "Thank you!"
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, who is the top deputy in the DA's office and will take over next week.
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."
Cosby also faces a raft of defamation and sexual-abuse lawsuits filed in Massachusetts, Los Angeles and Pennsylvania. But in nearly every case, it is too late to file criminal charges. One exception: a 2008 case involving a model at the Playboy Mansion in Los Angeles. It is still under investigation by police.
A key question if the Pennsylvania case goes to trial is whether the judge will allow 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.
In Los Angeles, celebrity attorney Gloria Allred, who represents more than two dozen Cosby accusers, pronounced the arrest "the best Christmas present they have ever received." She said her clients are willing to testify if called.
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 suburban Cheltenham 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.
Cosby's lawyer noted pointedly Wednesday that the charges come "on the heels of a hotly contested election" for DA in which the handling of the Cosby case became a major issue. Castor was seeking to reclaim his job as DA but lost to Steele.
Constand's 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 any wrongdoing, 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, who makes his home mostly in 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.
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."
Associated Press writer Errin Haines Whack in Philadelphia; Michael R. Sisak in Elkins Park; and John Rogers in Los Angeles contributed to this story.
This story has been corrected to fix the wording of the judge's "Good luck" quote.