CLICK ON PHOTOS FOR FULL GALLERY
The athlete's career in pictures
Judge Thokozile Masipa said that in a case of culpable homicide like this one a non-custodial sentence would send the wrong message.
Last month she accepted Oscar's explanation that he thought his girlfriend was an intruder, but ruled that he had been negligent and used excessive force.
The athlete was also given another three-year suspended sentence for an unrelated firearms offence.
Reeva Steenkamp profile: 'A gorgeous angel to her friends'
After Tuesday's hearing, Oscar held hands with his uncle Arnold and aunt Lois. He has been living with them during the trial and they've not missed a day of the proceedings.
Until a few months ago, the sprinter was estranged from his father Henke, but he was there for the sentencing, looking heartbroken as his son was led away down to the cells.
Outside the court, Oscar's uncle said the family accepted the judgement and said his nephew "would embrace the opportunity to pay back to society".
It's thought that the athlete will be able to apply for some form of house arrest in ten months. A lawyer for the Steenkamp family said the sentence was "welcome". Dup de Bruyn told AFP Oscar would probably serve two years in prison and three years under house arrest.
Oscar Pistorius hugs his formerly estranged father Henke
The judge said: "I have also taken into account the seriousness of the offence which led to the death of the deceased, the personal circumstances of the accused and the interests of society.
"I am of the view that a non-custodial sentence would send the wrong message to to the community.
"On the other hand, a long sentence would not be appropriate as that lacks the element of mercy."
She had begun proceedings by saying that although she had been helped by two legal advisers the decision was hers alone.
The judge added: "Sentencing is about achieving the right balance. Sentencing is not a perfect exercise." She said there must be a balance between retribution, deterrence and rehabilitation.
The prosecution had called for a minimum ten-year sentence; the Paralympian's defence team argued that he should face house arrest.