A psychologist rejected claims that Nel was mentally unfit to stand trial
A judge has sentenced a 19-year-old white South African to four life terms in jail for killing four black people in a shooting spree in January.
Those shot dead by Johan Nel included a three-month-old baby and a boy of 10. Witnesses told the court he shouted racist abuse while shooting.
The killings led to angry protests by thousands of people.
Correspondents say Nel showed no emotion as he was sentenced. The judge said racism could not be tolerated.
Police spokesman Lesego Metsi said Judge Ronald Hendricks and the prosecuting lawyer were under police protection after receiving 50 death threats on their mobile phones, the South Africa Press Association reports.
Superintendent Metsi told South Africa's Times newspaper that all the callers were white, who said Judge Hendricks would be killed if he handed down a life sentence.
Earlier psychologist Kobus Truter had rejected claims that Nel was mentally unfit to stand trial and had said he should be sentenced to between 20 and 25 years in prison.
Mr Truter said Nel, who was 18 at the time of the shooting, believed white people were under attack after his family and friends became the victims of several violent crimes.
The BBC's Mpho Lakaje in Johannesburg says that most people seem pleased that Nel was given life, as the shooting spree in the Skierlik settlement in a farming area of North West province really shook the nation.
In the last year there have been calls to reintroduce the death penalty, he says.
The Young Communist League welcomed the sentence.
"This sends a strong message that perpetrators of heinous and racist murders will be brought to book and rot in jail," the league said in a statement.
Nel was also sentenced to 68 years on 11 counts of attempted murder, five years for holding a firearm and three years for possession of ammunition.
Our reporter says Nel was told he would have to wait 25 years to negotiate parole.
His lawyers say they will appeal against the sentence.