Breivik has admitted killing 77 people in the attacks that traumatised Norway and shocked the world.
"In a unanimous decision … the court sentences the defendant to 21 years of preventive detention," said judge Wenche Elizabeth Arntzen.
Breivik has admitted killing 77 people in the attacks that traumatised Norway and shocked the world, claiming eight victims in an Oslo blast and taking 69 more lives, mostly teenagers', in a shooting frenzy at an island summer camp.
The 33-year-old loner – who sees himself as a Nordic warrior against Europe's "Muslim invasion" and against all those who promote multiculturalism – was widely expected to be locked away for 21 years, Norway's maximum prison sentence.
The main question was whether it will be in a jail cell or a mental ward.
Breivik, who laid out his hateful worldview in a rambling 1 500-page online manifesto, was diagnosed with paranoid schizophrenia and declared criminally insane after his bloody rampage on July 22 of last year.
A public outcry led to a second assessment, which found him legally sane – a view shared by most Norwegians in polls, and by Breivik himself who has said he would accept prison but appeal against closed psychiatric treatment.
Prosecutor Svein Holden, who wanted Breivik to be found criminally insane, has said that "it would be worse to sentence someone who is psychotic to prison than to send someone who is not psychotic to psychiatric care".
Delivering the verdict
The presiding judges delivered the verdict and sentence on terrorism charges in a hearing from 8am GMT, held in Oslo under tight security and attended by survivors, victims' relatives and media from around the world. "The most important thing for me is not whether 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 had said he would accept a sane verdict, but derided a jail term as "pathetic", and said acquittal or execution was the only reasonable outcomes.
Norway's penal code does not have the death penalty or life in prison and the maximum prison term for Breivik's charges is 21 years. However, inmates who are considered a threat to society can be held indefinitely.
In previous testimony during the 10-week trial that ran until June, Breivik laid out in chilling detail what motivated him to meticulously plan for years and then execute Norway's worst massacre since World War II.
Breivik has called himself a "foot soldier" for the "Knights Templar", allegedly a clandestine ultra-right group named after an order of Christian Crusaders of the Middle Ages. Police doubt the group's existence.
He has also railed against "cultural Marxists" whose support for immigration he blames for the emergence of a "Eurabia", the reason why he targeted the centre-left government and a summer youth camp run by the Labour Party.
The court heard how Breivik spent years planning the bloodbath, using a farm as cover for purchasing the chemical fertiliser he used for the almost one-tonne bomb he set off in a rented van outside Oslo's main government building.
Shooting spree
In his years of seclusion, Breivik said he practised meditation, worked out and used steroids to steel his mind and body, while playing video shooting and role-playing games for relaxation.
He joined a pistol club and obtained a hunting licence to get the 9mm Glock handgun and Ruger semi-automatic rifle which he used to mow down terrified youths, the youngest just 14, trapped on the tiny lake island of Utoeya.
Dressed in a police uniform, he methodically shot dead 67 people, many at point blank range, and two more died as they fell to their death or drowned while trying to escape the more than hour-long shooting spree.
The bungled police response in low-crime Norway has been much criticised.
The only police helicopter was out of action because its crew were on holiday, and a SWAT team took more than an hour to finally make it to the island, forced to use a pleasure boat after their inflatable almost sank.
Norway's national police commissioner resigned last week after a scathing report on the response, and Prime Minister Jens Stoltenberg is due to appear before an extraordinary parliamentary session later this month.
During his trial Breivik showed little emotion and no remorse and once described his mass slaughter as "cruel but necessary" to protect Norway from multiculturalism. At one stage he told the court: "I would do it again." – Sapa-AFP