Judge Thokozile Masipa said before handing down her sentence that she hoped the result would provide some closure to the Steenkamp family.
She said a sentence not involving confinement would send a wrong message to the public, and that a long jail sentence would lack an "element of mercy."
After the judged announced the sentence, Pistorius was taken from the courtroom to holding cells. His sentence begins immediately.
"Justice was served today," said Dup De Bruyn, the lawyer for the Steenkamp family.
Pistorius, 27, was given a three-year suspended sentence for a separate gun-related incident.
Masipa had a range of options after convicting him on Sept. 11 of culpable homicide including jail, a suspended sentence and house arrest. Pistorius was found not guilty of murder and not guilty of premeditated murder.
Before the shooting, Pistorius was seen as an athletic superstar and an inspiration after becoming the first Paralympian to compete in athletics at the Olympics, in 2012. He previously won six gold medals and eight medals overall at the Paralympics dating back to 2004.
Pistorius was born with a congenital condition that resulted in both legs being amputated under the knees when he was about a year old.
Steenkamp, a 29-year-old law school graduate and model, was fatally shot through a bathroom door on Feb. 14, 2013.
Pistorius, who fired four times, said he awoke in the middle of the night and believed an intruder was in his bathroom.
Pistorius' lawyers argued for a three-year period of correctional supervision, where the runner would spend periods under house arrest and also perform community service.
Prosecutors asked the judge to send him to prison for at least 10 years, citing the "horrific" nature of Steenkamp's death after she was shot multiple times.