OSLO — Convicted of killing 77 people in a horrific bombing and shooting attack in July last year, the Norwegian extremist Anders Behring Breivik was sentenced on Friday to 21 years in prison — fewer than four months per victim — ending a case that thoroughly tested this gentle country’s collective commitment to values like tolerance, nonviolence and merciful justice.

Mr. Breivik, lawyers say, will live in a prison outside Oslo in a three-cell suite of rooms equipped with exercise equipment, a television and a laptop, albeit one without Internet access. If he is not considered a threat after serving his sentence, the maximum available under Norwegian law, he will be eligible for release in 2033, at the age of 53.

However, his demeanor, testimony and declaration that he would have liked to kill more people helped convince the judges that, however lenient the sentence seems, Mr. Breivik is unlikely ever to be released from prison. He could be kept there indefinitely by judges adding a succession of five-year extensions to his sentence.

The relative leniency of the sentence imposed on Mr. Breivik, the worst criminal modern Scandinavia has known, is no anomaly. Rather, it is consistent with Norway’s general approach to criminal justice. Like the rest of Europe — and in contrast with much of the United States, whose criminal justice system is considered by many Europeans to be cruelly punitive — Norway no longer has the death penalty and considers prison more a means for rehabilitation than retribution.