The sentence was imposed for the charge of culpable homicide, which in South Africa means a person was killed unintentionally, but unlawfully.
Under South African law, he will have to serve at least one-sixth of his sentence -- 10 months -- before he can ask to be placed under correctional supervision, usually house arrest, instead.
Pistorius was also given a three-year sentence on a firearms charge, but it was suspended for five years on condition he's not found guilty of another crime where there's negligence involving a firearm during that period.
That count related to an occasion when Pistorius discharged a loaded handgun under a table in a busy restaurant. No one was hurt.
During his trial, the double-amputee sprinter often sobbed at the mention of his girlfriend Reeva Steenkamp's name. He insisted that he mistook her for an intruder when he shot her through a toilet door on Valentine's Day 2013.
But there was very little visible reaction from Pistorius as the sentence was read out.
Speaking to CNN's Robyn Curnow in the last few weeks before his sentencing, Pistorius told her that he would respect and accept the decision of the court and that he was not afraid of imprisonment.
He said he hoped to contribute while in prison by teaching people how to read or start a gym or running club.
"Oscar will embrace this opportunity to pay back to society," his uncle, Arnold Pistorius, told reporters. "As an uncle, I hope Oscar will start his own healing process as he walks down the path of restoration. As a family, we are ready to support and guide Oscar as he serves his sentence."
The Steenkamp family's lawyer, Dup De Bruyn, said in a statement: "The family is satisfied. They are glad that it is over and are satisfied that justice has been done."
Question of appeal
The prosecution had asked for a minimum prison sentence of 10 years for Pistorius.
After the ruling Tuesday, South Africa's National Prosecuting Authority said it has not yet decided whether to appeal Judge Thokozile Masipa's verdict that Oscar Pistorius is not guilty of murder.
Pistorius' defense has called for a sentence of house arrest and community service.
There was no immediate reaction from the defense team on the sentencing.
Both sides now have a 14-day period in which they can choose to lodge any appeal, according to CNN legal analyst Kelly Phelps.
On the eve of Pistorius' sentencing, his sister told CNN's Robyn Curnow that the lives of everyone close to the trial have already been changed forever, no matter the outcome.
"No one who's been close to the situation can just overcome it," Aimee Pistorius said. "It's something my brother will carry with him forever and ... regardless of what's happening now it's just a certain phase in a journey that will never end."
'Mine and mine alone'
Giving her reasoning Tuesday, Judge Thokozile Masipa emphasized that the decision on sentencing would be "mine and mine alone."
She pointed out that sentencing is not an exact science but relies on an assessment of elements including the nature and seriousness of the crime, the personal circumstances of the accused and the interests of society.
She said she would also take into account the factors in sentencing of retribution, deterrence and rehabilitation.
In any case, she said, "sentencing is about achieving the right balance."
Prison not 'insurmountable challenge'
In her final remarks, Masipa dismissed evidence given by probation officer Annette Vergeer that prison would not be able to accommodate Pistorius' disability, saying her testimony was outdated and sketchy.
She said Pistorius would not present the prison system with an "insurmountable challenge."
The judge added that she felt Pistorius' vulnerability had been overstated in the evidence given and that his excellent coping strategies -- shown in his ability to compete with able-bodied atletes -- had been overlooked.
He would be able to continue treatment for physical problems and mental health issues while in prison, she said.
Factors in decision
In terms of the seriousness of the offense, Masipa said Pistorius had shown gross negligence in shooting into a small toilet cubicle, knowing there was someone inside who could not escape. He also knew how to handle firearms, she said, adding that these were "very aggravating" factors.
On the other hand, mitigating factors include that Pistorius is a first offender and remorseful, Masipa said. She also mentioned his contribution to society in giving his time and money to charities and inspiring others with disabilities to believe they could succeed.
Perhaps seeking to preempt criticism from those who'd like to see either a tougher or more lenient sentence, Masipa pointed out that the purpose of the court is to serve the public interest, not make itself popular.
She also indicated that her sentence wasn't affected by Pistorius' fame.
"It would be a sad day for this country if the impression was to be created that there was one law for the poor and disadvantaged and another for the rich and famous," she said.
The judge also highlighted the loss suffered by Steenkamp's family, which has had a negative impact on her father's health.
Steenkamp was young, vivacious and full of life at the time of her death, she said.
"The loss of life cannot be reversed. Nothing I say or do today can reverse what happened," she said.
'Sweetest human being'
Steenkamp, 29, was a law school graduate who turned to modeling in recent years.
"She was the kindest, sweetest human being, an angel on earth," said her agency, Capacity Relations.
Pistorius, 27, made history when he became the first Paralympian to compete in the able-bodied Olympics in 2012. He was born without the fibulae in his legs, which were amputated below the knee when he was 11 months old.
At the London Olympics, he ran on special carbon fiber blades that earned him the nickname "Blade Runner." Even though he didn't medal, he became an inspiration to the disabled and a national hero in South Africa.
The International Olympic Committee declined to say Tuesday whether Pistorius would be allowed to compete again after being sentenced for Steenkamp's killing.
''We take note of the court's decision. This is a human tragedy for the family of Reeva Steenkamp and also for Oscar Pistorius. We hope very much that time will bring comfort to all those concerned but at this stage we have no further comment to make," the IOC said in a written statement to CNN.