A Norwegian court found Anders Behring Breivik sane on Friday and gave him a maximum jail term for murdering 77 people in a shooting and bombing last year, offering closure to a Nordic nation devastated by its worst attack since World War Two.
Breivik, who has admitted blowing up the Oslo government headquarters with a fertiliser bomb, killing eight, before gunning down 69 at the ruling party's summer youth camp, was sentenced to 21 years in prison, the maximum penalty in Norway.
But officials can prevent his release indefinitely and are expected to do so if the anti-Muslim right-winger still poses a threat. Breivik had rejected prosecutors' arguments that he was mad, and had said he would appeal if he were ruled insane.
"In a unanimous decision ... the court sentences the defendant to 21 years of preventive detention," said judge Wenche Elizabeth Arntzen, dismissing the prosecutor's call for a verdict that would have labelled Breivik insane and have confined him indefinitely to psychiatric care.
The killings shook this nation of five million which had prided itself as a safe haven from much of the world's troubles, raising questions about the prevalence of far-right views in a country where oil wealth has attracted rising immigration.
Breivik, 33, will be kept in isolation inside Ila Prison on the outskirts of Oslo inside relatively spacious quarters that include a separate exercise room, a computer and a television.
Criminal guilt was never an issue as Breivik acknowledged and described in horrific detail his murders. His 10-week trial focused on his sanity, with prosecutors arguing he should be declared insane and held in a mental hospital, not jail.
For many survivors the actual verdict was academic. But the trial that went into every detail of the day-long killing spree, Norway's worst massacre since the Second World War, offered some closure for families.
Some survivors wanted a sane verdict, which makes clear that Breivik is responsible for his actions and also makes a protracted appeal unlikely.
Breivik has described an insane verdict as "a fate worse than death". Were he to have been found insane and decided to appeal, the entire trial would have had to be repeated.
Breivik justified his killing spree arguing that the centre-left Labour party is deliberately destroying the nation by encouraging Muslim immigration.
Although his victims were mostly teenagers, with some as young as 14, he rejected being called a child murderer, arguing that his victims were brainwashed "cultural Marxists" whose political activism would adulterate pure Norwegian blood.
He stalked his victims dressed as a policeman, tricking them into thinking he was the help sent from the shore, then shot them from close range before finishing them with a shot to the head.
"I stand by what I have done and I would still do it again." he said during his court testimony.
One team of court appointed psychiatrists concluded he was psychotic while another came to the opposing conclusion. To make the ruling more difficult, several other experts who testified described a slew of mental conditions Breivik probably suffered.
Still, polls showed that around 70 percent of Norway's public thought such a complex attack could not have been carried out by a madman and Breivik had to bear responsibility.
"The most important thing for me is not weather he is sent to a mental hospital or jail, it's just that he remains off the streets (and) he is never let out," Vegard Groslie Wennesland, a survivor of the attack said before the verdict.
Breivik has said he would accept a sane verdict, but derided a jail term as "pathetic", and said acquittal or execution were the only reasonable outcomes.
A commission investigating the attack earlier this month concluded that all of part of it could have been prevented and intelligence, police and government blunders likely cost lives.