Bill Cosby has arrived for a sentencing hearing that will determine how the comedian will be punished for drugging and sexually assaulting a woman more than 14 years ago.

Cosby was the first celebrity to go on trial in the MeToo era and could be the first to go to prison – perhaps for the rest of his life – after being convicted in April of violating Temple University employee Andrea Constand at his suburban Philadelphia home in 2004.

The 81-year-old, looking grim, walked into the courthouse in suburban Philadelphia on the arm of his longtime spokesman as protesters shouted at him.

At the end of the potentially two-day hearing, Montgomery County Judge Steven T O’Neill could sentence Cosby to as many as 30 years in prison or send him home on probation.

The state guidelines for someone like Cosby, with no prior convictions, call for about one to four years behind bars.

Television vans line the street in front of the Montgomery County Courthouse ahead of Bill Cosby's sentencing
Television vans line the street in front of Montgomery County Courthouse (Matt Rourke/AP)

Cosby is legally blind and uses a cane, something his lawyers are certain to point out along with his achievements and philanthropy.

Prosecutors hoped to call some of his other accusers to paint Cosby as a sexual predator deserving of prison.

Whatever the sentence, Cosby is likely to be deemed a sexually violent predator and will have to undergo monthly counselling for the rest of his life, in prison or out.

Neighbours and schools will be warned he is living nearby.

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

Just a few hours before the sentencing hearing was to begin, Ms Constand tweeted a Bible verse about letting go of anger: “Be wrathful, but do not sin; do not let the sun set while you are still angry; do not give the Devil an opportunity.”

Cosby, who grew up in public housing in Philadelphia, became the first black actor to star in a prime-time TV show, I Spy, in 1965.

Bill Cosby in 1992 during the final episode of The Cosby Show
Bill Cosby in 1992 during the final episode of The Cosby Show (AP)

He remained a Hollywood A-lister for much of the next half-century, hitting his peak in the 1980s with the top-rated Cosby Show as the warm, wisecracking father Dr Cliff Huxtable.

But behind the scenes, according to evidence, the married star sought out sexual encounters with young women, including actresses he offered to mentor, models seeking a part on his shows, and flight attendants he met during his travels.

He also acknowledged obtaining quaaludes in the 1970s to give to women before sex.