His Hollywood career and good-guy image in ruins, 81-year-old Bill Cosby was sentenced Tuesday to three to 10 years behind bars for drugging and sexually assaulting a Canadian woman, becoming the first celebrity of the #MeToo era to go to prison.

The punishment all but completed the dizzying, late-in-life fall for the comedian, former TV star and breaker of racial barriers.

"It is time for justice. Mr. Cosby, this has all circled back to you. The time has come," said Montgomery County Judge Steven O'Neill.

It is time for justice. Mr. Cosby, this has all circled back to you. - Judge Steven O'Neill

He quoted from victim Andrea Constand's own statement to the court, in which she said Cosby took her "beautiful, young spirit and crushed it."

Cosby declined the opportunity to address the court before the sentence came down. He sat back in his chair, his head on the headrest, as the sentence was read.

Cosby's lawyers asked that he be allowed to remain free on bail while he appeals his conviction, but the judge appeared incredulous over the request and turned it down, saying that even considering Cosby's age and blindness, "he could quite possibly be a danger to the community."

Cosby, who was also fined $25,000 US, was led away from the Pennsylvania courtroom in handcuffs to begin serving the sentence.

A spokesperson for the Montgomery County district attorney's office says Cosby will be held at the county jail for at least the next few days. From there, he'll be taken to SCI Phoenix, a new state prison outside Philadelphia, where staff will assess his physical, medical and security needs to determine whether he will serve his time on a long-term medical care unit.

Prosecutor says Cosby has been 'unmasked'.

District attorney says his office treated famous comedian like any other defendant 2:25

The ruling came at the end of a two-day hearing at which the judge declared Cosby a "sexually violent predator" — a modern-day scarlet letter that subjects him to monthly counselling for the rest of his life and requires that neighbours and schools be notified of his whereabouts.

The comic once known as America's Dad for his role on top-rated The Cosby Show in the 1980s was convicted in April of violating Constand, then-Temple University women's basketball administrator, at his suburban Philadelphia estate in 2004.

Cosby faced a sentence of anywhere from probation to 10 years in prison. His lawyers 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 he could still pose a threat to women.

Montgomery County District Attorney Kevin Steele rejected the notion that Cosby's age and infirmity entitle him 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.

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. - Montgomery County District Attorney Kevin Steele

The sentencing came as another extraordinary #MeToo drama unfolded on Capitol Hill, where Supreme Court nominee Brett Kavanaugh faces allegations of sexual misconduct more than three decades ago.

The Cosby case "really raised awareness of the pervasiveness of … sexual misconduct against subordinates and against women of relatively less power," said Daniel Filler, dean of the Drexel University law school in Philadelphia.

"For jurors, I think it's inherently changed the credibility of the accusers."

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 led to criminal charges.

Speaking after the sentencing, Steele thanked Constand and said for years she had been a "rock," who has "done the right thing over and over and over again."

"She could have stayed home in Canada and she could have lived a quiet life, but she knew it was important to see that justice was served," he said.

Constand was a 'rock' throughout lengthy prosecution, DA says.

Canadian victim of Bill Cosby did the right thing 'over and over', prosecutor says 1:52

The judge ruled on Cosby's "sexually violent predator" status after a psychologist for the state testified that the entertainer appears to have a mental disorder that gives him an uncontrollable urge to have sex with women without their consent. When the ruling came down, a woman in the courtroom shot her fist into the air and whispered, "Yessss!"

In a blistering statement, Cosby spokesman Andrew Wyatt said the comic was subjected to "most racist and sexist trial in the history of the United States."

Among other things, Wyatt said all three of the psychologists who testified against Cosby were "white women who make money off of accusing black men of being sexual predators," and he accused prosecutors of using a doctored recording of a telephone conversation between Constand's mother and Cosby.

'Stuck in a holding pattern'

In a statement submitted to the court and released Tuesday, Constand, now 45, said that she has had to cope with years of anxiety and self-doubt. She 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."

A sign sits in front of Montgomery County Correctional Facility in Eagleville, Pa. Cosby was taken to the facility after being sentenced. (Jacqueline Larma/Associated Press)

She also wrote of Cosby: "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."

The AP does not typically identify people who say they are victims of sexual assault unless they come forward publicly, which Constand and other women have done.

Constand went to police a year after waking up in a fog at Cosby's gated estate, her clothes askew, only to have the district attorney pass on the case.

Another district attorney reopened the file a decade later and charged the TV star after standup comic Hannibal Buress's riff about Cosby being a rapist prompted more accusers to come forward and after a federal judge, acting on a request from The Associated Press, unsealed some of Cosby's startling, decade-old testimony in Constand's related civil suit.

In his testimony, Cosby described sexual encounters with a string of actresses, models and other young women and talked about obtaining Quaaludes to give to those he wanted to sleep with.

Toronto-based Andrea Constand is one of about 60 women who have accused Cosby of sexual misconduct, though none except her claims has led to criminal charges. (David Maialetti/The Philadelphia Inquirer/Associated Press)

Cosby's first trial in 2017 ended with a hung jury. He was convicted at a retrial that opened months after the #MeToo movement had taken down such figures as Hollywood studio boss Harvey Weinstein, NBC's Matt Lauer, actor Kevin Spacey and Sen. Al Franken.

Constand said Cosby gave her what she thought were herbal pills to ease stress, then penetrated her with his fingers as she lay immobilized on a couch. Cosby claimed the encounter was consensual, and his lawyers branded her a "con artist" who framed the comedian to get a big payday — a $3.4 million US settlement she received over a decade ago.

Five other accusers took the stand at the trial as part of an effort by prosecutors to portray him as a predator.

Career now collapsed

Cosby, whose estimated fortune once topped $400 million, broke barriers in the 1960s as the first black actor to star in a network show, I Spy. He went on to superstardom as wise and understanding Dr. Cliff Huxtable on The Cosby Show, a sitcom that showed America a new kind of black TV family: a warm and loving household led by two professionals, one a lawyer, the other a doctor.

He also found success with his Saturday morning cartoon Fat Albert, appeared in commercials for Jell-O pudding and became a public moralist, lecturing the black community about young people stealing things and wearing baggy pants. He won a Presidential Medal of Freedom and countless Emmys, Golden Globes and Grammy awards.

As the allegations mounted, his career all but collapsed, The Cosby Show reruns were taken off the air, and one college after another stripped him of his honorary degrees.