Former Khmer Rouge prison chief Duch has been found guilty of crimes against humanity by Cambodia's UN-backed war crimes tribunal.
Duch, 67, whose full name is Kaing Guek Eav, was sentenced to 35 years in prison.
He had admitted overseeing the torture and execution of thousands of men, women and children at the notorious Tuol Sleng prison, and asked for forgiveness.
This is the tribunal's first verdict.
Prosecutors had asked the judges for a 40-year prison sentence.
However, Duch will not serve the full 35 allotted years as judges reduced the sentence by five years because he had been held illegally, and reduced it by a further 11 years for time already served behind bars.
Wearing a blue shirt, the former Khmer Rouge jailer looked pensive and slumped in his chair as proceedings were held behind a floor-to-ceiling bullet-proof screen which separated the public gallery from the rest of the court.
Reading out the sentence, the president of the five-judge panel said it reflected the "shocking and heinous" nature of the offences.
Crowds of Cambodians attended the specially built court on the outskirts of the capital, Phnom Penh, to hear the verdict, which was also broadcast live across the country.
Some said they wanted a tougher sentence. "There is no justice. I wanted life imprisonment for Duch," said Hong Sovath, whose father was killed in Tuol Sleng.
"I can't accept this," Saodi Ouch, 46, told the Associated Press news agency. "My family died... my older sister, my older brother. I'm the only one left."
But Chea Leang, one of the co-prosecutors, said the sentence showed that those who committed crimes during the Khmer Rouge era would be punished.
"Those who have taken many lives cannot avoid justice," she said.
Duch ran Tuol Sleng prison, where "enemies" of the Khmer Rouge regime were sent.
Up to two million people died because of the policies of the Khmer Rouge, which ruled Cambodia from 1975-1979.
Their policies included the evacuation of cities, forced labour in the rice fields and the summary execution of those considered enemies of the revolution.
The group's top leader, "Brother Number One" Pol Pot, died in 1998.
Duch, the first of five surviving senior figures of the Khmer Rouge to go on trial, was widely expected to be found guilty of war crimes and crimes against humanity by the court.
Despite acknowledging the role he played at Tuol Sleng, codenamed "S-21", he insisted that he had only been following orders from his superiors, and on the trial's final day in November shocked many by asking to be acquitted.
But prosecutors said the former maths teacher ordered the use of brutal torture methods to extract "confessions" from detainees - including pulling out toenails and administering electric shocks - and approved all the executions.
A meticulous record-keeper, Duch built up a huge archive of photos, confessions and other evidence documenting those held at Tuol Sleng.
In one memo he kept, a guard asked him what to do with six boys and three girls accused of being traitors. He replied: "Kill every last one."
After the Khmer Rouge were overthrown, Duch disappeared for almost two decades, living under various aliases in north-western Cambodia and converting to Christianity. His chance discovery by an Irish journalist led to his arrest in 1999.
Only about a dozen people who were held at Tuol Sleng are thought to have survived, three of whom are still alive. Up to 17,000 people are believed to have died there.
The other Khmer Rouge leaders awaiting trial are "Brother Number Two" Nuon Chea, former head of state Khieu Samphan, former foreign minister Ieng Sary and his wife Ieng Thirith, the minister of social affairs.