Bill Cosby was sentenced to three to 10 years in state prison at a Norristown, Pennsylvania, court on Tuesday.

The 81-year-old comedian faced up to 10 years in prison after he was convicted in April of drugging and sexually assaulting a woman over a decade ago.

A judge declared Cosby a "sexually violent predator" ahead of his sentencing, requiring the comic's name to appear on a sex-offender registry.

Bill Cosby was sentenced to three to 10 years in state prison at a Norristown, Pennsylvania, court on Tuesday.

The 81-year-old comedian faced up to 10 years in prison after he was convicted in April of drugging and sexually assaulting Temple University women's basketball administrator Andrea Constand at his suburban Philadelphia estate in 2004.

Montgomery County Judge Steven O'Neill made the decision after declaring Cosby a "sexually violent predator" ahead of his sentencing, requiring the comic to appear on a sex-offender registry and undergo monthly counseling for the rest of his life.

"It is time for justice. Mr. Cosby, this has all circled back to you. The time has come," O'Neill said in his sentencing decision.

Cosby's lawyers asked that he be allowed to remain free on bail while he appealed his conviction, but the judge denied the bail request and ordered Cosby to be imprisoned immediately. Cosby was led away in handcuffs.

Prior to the sentencing, Cosby's lawyers had asked for house arrest, saying Cosby — who is legally blind — is too old and vulnerable to do time in prison. Prosecutors asked for five to 10 years behind bars, saying the comic could still be a threat to women. He will serve his time in state prison.

Montgomery County District Attorney Kevin Steele rejected the notion that "age, infirmity, should somehow equate to mercy."

"He was good at hiding this for a long time. Good at suppressing this for a long time. So it's taken a long time to get there," Steele said.

Cosby's lawyers had fought the "sexually violent predator" designation, arguing that Pennsylvania's sex-offender law is unconstitutional and that he is no threat to the public at his age. But O'Neill said prosecutors had met their burden of proof by "clear and convincing" evidence.

When the ruling came down, a woman in courtroom shot her fist into the air and whispered, "Yes!"

Meanwhile, Constand said in a statement submitted to the court and released Tuesday that she has had to cope with years of anxiety and self-doubt that had left her "stuck in a holding pattern."

Constand, 45, said her training as a professional basketball player had led her to think she could handle anything, but "life as I knew it" ended on the night she said Cosby knocked her out with pills and penetrated her with his fingers as she lay nearly paralyzed on a couch.

Constand said she now lives alone with her two dogs and has trouble trusting people.

"When the sexual assault happened, I was a young woman brimming with confidence and looking forward to a future bright with possibilities," she wrote in her five-page statement.

"Now, almost 15 years later, I'm a middle-aged woman who's been stuck in a holding pattern for most of her adult life, unable to heal fully or to move forward."

She also wrote: "We may never know the full extent of his double life as a sexual predator but his decades-long reign of terror as a serial rapist is over."

In the years since Constand first went to authorities in 2005, more than 60 women have accused Cosby of sexual misconduct, though none of those claims have led to criminal charges.

Cosby was smiling and joking with his spokesman and sheriff's deputies as he settled into the courtroom Tuesday. On Day 1 of the sentencing, the comic laughed at times as the psychologist for the state testified.

Cameras were not allowed in the courtroom; they are generally banned in Pennsylvania.

Cosby became the first black actor to star in a prime-time TV show, "I Spy," in 1965. He remained a Hollywood A-lister for much of the next half-century.