Oslo, Norway (CNN) -- Anders Behring Breivik, the man who killed 77 people in a bomb attack and gun rampage just over a year ago, was judged to be sane by a Norwegian court Friday, as he was sentenced to 21 years in prison.
Breivik was charged with voluntary homicide and committing acts of terror in the attacks in Oslo and on Utoya Island on July 22, 2011.
The issue of Breivik's sanity, on which mental health experts have given conflicting opinions, was central to the court's ruling.
Breivik, who boasts of being an ultranationalist who killed his victims to fight multiculturalism in Norway, wanted to be ruled sane so that his actions wouldn't be dismissed as those of a lunatic.
He says he acted out of "necessity" to prevent the "Islamization" of his country.
But prosecutors had asked that Breivik, 33, be acquitted on the grounds of insanity, in which case he would have been held in a secure mental health unit.
The unanimous verdict was delivered at Oslo district court by a panel of five judges.
Breivik, dressed in a dark suit and tie, had a slight smile on his face as the decision was given.
He was sentenced to the maximum possible term of 21 years and was ordered to serve a minimum of 10 years in prison.
The sentence could be extended, potentially indefinitely, in the future if he is considered still to pose a threat to society. Norway does not have the death penalty.
Breivik has said he won't appeal the verdict. The chief prosecutor also confirmed Friday that the prosecution does not intend to lodge an appeal.
Bjorn Ihler, a survivor of the Utoya Island attack, told CNN he was glad the trial had concluded and that justice had been done.
"It's been an amazingly difficult process. It's been a constant, constant reminder of why we have to fight extremism in every way possible," he said of the trial.
"We have to make sure nothing like this ever happens again."
The court's judgment that Breivik is sane means that the far-right views he espouses can be confronted in Norway without being dismissed as those of a madman, Ihler said.
"There are extremist people around, they are not insane, and we have to be able to take a proper debate with them," he said.
Asked whether the verdict meant closure for him, Ihler said: "This case is going to live strongly with me for the rest of my life probably."
Reading out the court's ruling, Judge Wenche Elizabeth Arntzen spoke of Breivik's "manifesto," a document published online in which he set out his ultranationalist political views.
Breivik claimed to belong to a far-right group called the Knights Templar but the court found no evidence of its existence, the judge said.
He described his actions as a pre-emptive attack in defense of ethnic Norwegian people and culture, the court heard.
Breivik trained for his attack by working out in the gym, running with a backpack filled with rocks and practicing at a shooting club, the court heard.
He was under the influence of ephedrine, a stimulant, at the time of the attacks, and the possibility that this contributed to his behavior cannot be ruled out, Judge Arne Lyng said. He used meditation techniques to cut off his emotions, Lyng said.
In the course of the 10-week trial, which wrapped up in June, the court heard chilling evidence from some of those who survived Breivik's shooting spree on Utoya Island, in which 69 people died -- most of them teenagers attending a Labour Party summer youth camp.
In his own testimony, given without emotion, Breivik recounted firing more bullets into teenagers who were injured and couldn't escape, killing those who tried to "play dead" and driving others into the sea to drown.
His fertilizer bomb attack against government buildings in Oslo also killed eight people and injured many more.
It was only luck that more people were not killed and hurt in the blast, the court heard.
Breivik blames politicians, and the Labour Party in particular, for promoting multiculturalism in Norway.
He has been held in a "particularly high security" wing of Ila Prison since his detention immediately after the killings.
The prison's governor, Knut Bjarkeid, said Wednesday that the institution was ready to hold Breivik securely whether the court ruled him sane or not. "Our job is to protect the community," Bjarkeid said.
Over the past year, Breivik has had three cells for his use, one for physical exercise and another for reading and writing, as well as a separate outdoor exercise space, he said. Breivik cannot mix with prisoners from other wings, but does have contact with prison staff.
"As of now, we think there is a need to subject Mr. Behring Breivik to a particularly high security regime," Bjarkeid said.
The high security regime "puts a heavy strain on an inmate, especially if it lasts for a longer period," he added, so Breivik's continued detention under these conditions will be kept under constant review.
Defense lawyer Geir Lippestad has previously said it is important to Breivik that people see him as sane so they don't dismiss his views.
The court had to consider conflicting opinions from medical experts in reaching its verdict.
An initial team of psychiatrists found Breivik to be paranoid and schizophrenic, following 36 hours of interviews.
However, a second pair of experts found he was not psychotic at the time of the attacks, does not suffer from a psychiatric condition and is not mentally challenged.
Their report said there is a "high risk for repeated violent actions."
Mark Stephens, a partner at law firm Finers Stephens Innocent, told CNN Friday: "The general public will think only a madman can commit these offenses, but in law madness is defined very narrowly. Basically it requires a doctor to come to court and say this person has a definable medical illness -- in this case the prosecution said he was a paranoid schizophrenic, and that can be treated with drugs and behavioral therapy.
"If, however, he had a personality disorder or was just ... motivated, as in this case, by a misguided political belief that this was the only way to stop the Islamization, as he would have it, of his nation, then in those circumstances he has be found guilty because he understood what he was doing was wrong."
Breivik's rampage, the worst atrocity on Norwegian soil since World War II, prompted much soul-searching.
Norwegians reasserted their commitment to multiculturalism and tolerance at a series of mass public tributes held in the immediate aftermath of the massacre.
And earlier this month, Norway's chief of police stepped down after an independent commission detailed a catalog of police and intelligence failures.
It concluded that those errors cost police 30 minutes in getting to Utoya, and that dozens of lives might have been saved.
Speaking last month on the anniversary of the killings, Prime Minister Jens Stoltenberg urged Norwegians to "honor the dead by celebrating life," and said Breivik had failed in his attempt to change Norway's values.
CNN's Diana Magnay and Per Nyberg reported from Oslo and Laura Smith-Spark from London.