Pistorius stood and faced Judge Thokozile Masipa as she announced the sentence in a South African courtroom on Wednesday.
The double-amputee Olympic runner had been facing a possible 15-year jail term after his manslaughter conviction was overturned.
But Masipa said substantial and compelling circumstances existed in the double-amputee Olympic runner's case to give him a lesser sentence.
Steenkamp's parents, Barry and June, were present in the courtroom, which was packed with relatives of both Pistorius and Steenkamp and other observers. The Steenkamps left the court after sentencing making no comment.
In reading out the sentence, Judge Masipa said Pistorius was a "fallen hero." She also described the 29-year-old as a "good candidate for rehabilitation."
Pistorius was composed after the sentence was announced, embracing his aunt and tearful sister before being led down a courtroom staircase to a holding cell.
The judge ordered a recess to give prosecutors and Pistorius' defence lawyers time to decide if either wanted to appeal the sentence. According to Sky reporter Alex Crawford, who was at the hearing, they have 14 days to decide this.
Pistorius shot Steenkamp through a toilet cubicle door at his home, and claimed he mistook her for an intruder. Prosecutors said the athlete killed his girlfriend intentionally after an argument.
Pistorius was initially acquitted of Steenkamp's murder at a trial in 2014. He served a year in jail for manslaughter but his conviction was changed to murder by South Africa's Supreme Court last year.
Pistorius had both legs amputated below the knees when he was 11-months-old because of a congenital defect.
He made history by running at the 2012 Olympics on his carbon-fiber running blades, and was one of the world's most recognisable athletes.