Oscar Pistorius held the hands of family members after being sentenced to five years in prison.
But, as Mr. Pistorius descended the courtroom steps to begin his sentence, his lawyers said the law under which he was punished calls for him to serve only one-sixth of the prison term — 10 months — before being released to house arrest.
At the North Gauteng High Court in Pretoria, the South African capital, Judge Thokozile Matilda Masipa announced her ruling after seven months of often-delayed hearings that have been broadcast around the world and captivated people in Mr. Pistorius’s own country and abroad.
The prosecution had sought a 10-year jail term, while the defense had requested that he be placed under house arrest for three years and perform community service.
The disabled athlete has admitted killing Ms. Steenkamp, 29, on Feb. 14, 2013, but he said he did so by mistake, firing four rounds from a handgun through a locked toilet cubicle door in the belief that an intruder had entered his home.
Judge Masipa spent 65 minutes summing up her decision before telling the athlete, “Mr. Pistorius, please rise.”
The judge also imposed a suspended three-year sentence on a separate firearms charge. The court then adjourned, and Mr. Pistorius, who has been free on bail for most of the time since the shooting, was led down the steps inside the courtroom to the cells.
Quoting at length from legal precedents, Judge Masipa said her sentence was “about achieving the right balance — proportionality.”
She was critical of the testimony of two defense witnesses, who had said Mr. Pistorius should be given a sentence of house arrest with community service. But she praised the testimony of Zach Modise, a senior prison services officer who said that South African prisons were equipped to deal with a disabled inmate’s needs.
Judge Masipa said a long sentence would lack “mercy,” while a more lenient sentence would “send the wrong message to the community.”
At the same time, she said, “the courts do not exist to win popularity contests.”
“It would be a sad day for this country if an impression was created that there is one law for the poor and disadvantaged and another for the rich and famous,” she said.