Breivik, a self-styled anti-Muslim militant, looked pleased as Judge Wenche Elisabeth Arntzen read the ruling, declaring him sane enough to be held criminally responsible for Norway's worst peacetime attacks.
The judgment could mark the end of a legal process that has haunted Norway in the 13 months since Breivik's rampage on July 22, 2011.
His lawyers said before the ruling that he would accept a prison term, and only appeal if ruled insane.
Going against the recommendation of prosecutors, who had asked for an insanity ruling, the five-judge panel in the Oslo district court convicted Breivik of terrorism and premeditated murder.
They imposed a sentence of "preventive detention," a special prison term for criminals considered dangerous to society. Prosecutors have not said if they would appeal.
The judges set the minimum length of imprisonment to 10 years and the maximum at 21 years, the longest allowed under Norwegian law.
However, such sentences can be extended as long as an inmate is considered too dangerous to be released.
Legal experts have said that in Breivik's case that could mean he will spend the rest of his life in prison.