The creator of cartoon character Fat Albert must now undergo monthly counseling for the rest of his life and report quarterly to authorities.
Exactly how much jail time Cosby will serve is still to be decided but he faces a maximum term of 10 years.
Cosby was convicted in April of drugging then sexually assaulting Andrea Constand, now 45.
During the sentencing hearing, which began on Monday in the US, Judge O'Neill heard from both the defense and the prosecution, as well as testimony and victim impact statements from the women, who have accused Cosby.
Bill Cosby is going away, but his star on the Hollywood Walk of Fame isn't going anywhere.
A member of the board said Cosby has a mental disorder that involves urges toward nonconsenting women.
She said: "He robbed me of my health and vitality, my open nature, and my trust in myself and others".
Bill Cosby leaving the courthouse yesterday, about to enjoy his last night of house arrest before years of incarceration.
The sole defense witness, Timothy Foley, a psychologist, testified that he believed the entertainer's risk of assaulting another person was "extraordinarily low".
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.
At his initial trial previous year, Cosby's first jury was deadlocked. His lawyers asked for house arrest.
Cosby'sprison sentence completes the TV dad's stunning fall from groundbreaking cultural icon to convicted sex offender.
Montgomery County District Attorney Kevin Steele scoffed at the notion.
O'Neill ordered Cosby to serve in "total confinement" for "no less than three years and no more than 10 years".
Cosby's wife, Camille, has not been present at the sentencing.
"To say that he is too old to do that - to say that he should get a pass because its taken this long to catch up to what he's done?"
She added: "I want years of prison because he deserves years in prison, yes he does".
"You said words to the effect that, 'For 30 years, I didn't know I had been raped, ' " said Cosby attorney Thomas Mesereau during cross-examination.
The decision is ultimately up to O'Neill, who oversaw Cosby's 2018 retrial, as well as his mistrial a year earlier that ended in a hung jury.
Across the television-watching world, he was revered for his signature role, affable obstetrician and father Cliff Huxtable on "The Cosby Show", which ran from 1984-92.