BILL COSBY was sentenced to 3 to 10 years in prison yesterday, for drugging and sexually assaulting Andrea Constand in 2004.  He was also hit with a $25,000 fine, and declared a “sexually violent predator.”

Prosecutors were asking for 5 to 10, while his lawyers were pushing for house arrest.  The sentence was reduced from a maximum of 30 years, after some of the charges were combined.  Bill is 81 years old.

Before he was led away in handcuffs, the judge told him, quote, “It is time for justice.  Mr. Cosby, this has all circled back to you.  The time has come.”  (Here’s Bill’s mugshot.)

Former supermodel JANICE DICKINSON, who was in the courtroom as one of Cosby’s accusers, told him, quote, “Here’s the last laugh, pal.”

Cosby actually DID laugh while talking with his lawyers after the verdict came down, but his spokesman said Cosby had been subjected to, quote, “the most racist and sexist trial in the history of the United States.”  (Here’s video.)

He also linked Cosby’s fate to the controversy surrounding Supreme Court nominee BRETT KAVANAUGH, claiming both men are victims of a “sex war” that’s going on right now.

Cosby did get some good news though:  They’re not removing his star from the Walk of Fame.

The Hollywood Chamber of Commerce said, quote, “Once installed, the stars become part of the historic fabric of the Walk of Fame, a ‘designated historic cultural landmark,’ and are intended to be permanent.

Although they added that it’s, quote, “regrettable when the personal lives of inductees do not measure up to public standards and expectations.”

TMZ says Cosby’s first meal behind bars was set to include vanilla pudding.  No word if it was JELL-O pudding, though.

(Here’s a list of Cosby’s FIVE DOZEN accusers, and the details of their alleged assaults.)