The darkest chapter in Norway's recent history came to a close, as judges delivered a sentence that is likely to see Anders Behring Breivik spend the rest of his life in prison, before they read out harrowing accounts of the gun and bomb attacks he perpetrated last year.

An Oslo court found that Breivik, whose twin assaults killed 77 people, was sane – the verdict that he and most Norwegians had wanted.

The conclusion of Norway's most high-profile judicial case for decades provoked immediate calls for the country to engage in a more rounded and open debate on multiculturalism.

Survivors and relatives welcomed the court's decision, saying they were now able to move on with their lives, 13 months after Breivik detonated a bomb in Oslo and embarked on a shooting rampage on Utøya island. More than half of those shot were teenagers.

The 33-year-old, who had earlier admitted the attacks that traumatised the peaceful country, smirked as the court's verdict was delivered. He was given the maximum sentence of 21 years, but with a "preventive detention" clause that means his time in jail can be extended as long as he is deemed a threat to society. It is unlikely he will ever be released.

In a final parting shot, clearly designed to offend, Breivik used his chance to address the court by apologising to "militant nationalists" across Europe, apparently for not killing more people during his two attacks.

More than 60 relatives and survivors of the attacks nodded silently in the Oslo courtroom as the verdict was delivered by Judge Wenche Elisabeth Arntzen. Later they could be seen embracing one another. Most of the Norwegian public had hoped for a "sanity" verdict, eager that the killer should be made accountable for what they viewed as a political crime. Breivik sought the same outcome, believing it would legitimise the ideology that inspired his attacks.

Away from the courthouse, a feeling of closure was soon evident throughout the nation. Bjørn Kasper Ilaug, a rescue worker at Utøya, said: "The verdict is positive toward a situation where we can start moving forward. That is very important. This has been a heavy burden for many people for 13 months."

Breivik had targeted a summer camp of the youth wing of the country's ruling Labour party, which was taking place on the island. Another Utøya survivor, Frida Holm Skoglund, 20, said: "I'm going to fully live the first day of the rest of my life." Skoglund had remained so shaken by her ordeal that, in May, she requested that Breivik leave the courtroom before she could deliver her witness testimony.

Others described a sense of instant calm. Per Balch Sørensen, whose daughter was killed on Utøya, said: "Now we can have peace and quiet. He doesn't mean anything to me. He is just air."

Within moments of the verdict, lawyers for the victims were being inundated with celebratory emails. Mette Yvonne Larsen, who represented some of those affected, said: "This is what we hoped for. I have already received many messages from clients telling me this is justice served and they are happy it's over and will never have to see him [Breivik] again."

The killings induced a period of introspection for a nation of 5 million which had prided itself as a safe and stable society, and also raised questions about the prevalence of far-right views in a country where oil wealth has encouraged one of the fastest immigration rates in Europe.

Many Norwegians believe their country must use the verdict as a platform to instigate an examination of the virtues or otherwise of mass immigration for its society.

Breivik said that he had deliberately targeted those he felt encouraged multiculturalism, and that he wanted to overcome an "invasion of Muslims". Jo Stigen, professor at the department for public and international law at the University of Oslo, said: "It was a political attack. Now we can focus on how to avoid this in the future."

Mads Andenæs, a lawyer and professor at the university, who lost a student during Breivik's killing spree, said: "Everybody is happy with this as the end of the process. Discussion about immigration and racism and how [Breivik's] attitude was possible to develop can now start."

Chief among the issues to be explored will be how Breivik could emerge in a society with one of the lowest homicide rates in the world. Utøya survivor Eivind Rindal was among those who warned that Breivik's ideological, far-right discourse was far from unique. "There are many who shared his extreme views in our society," she said. The judges agreed, noting that Breivik's anti-immigration views were shared by a nexus of like-minded individuals and disparate groups.

However, they found no evidence that the Knights Templar, the modern-day crusader network that Breivik claimed to belong to, exists. The killer appeared to blush each time the organisation was mentioned during the court hearing.

One aspect of the judgment was seemingly to make sure Breivik's actions were not forgotten, with the judges delivering a harrowing reminder of his attacks as they documented, over several hours, each of the gunshot and bomb-blast injuries suffered by those killed and the 242 wounded. The court heard some women were shot up to eight times, many cold-bloodedly with bullets to the head. As the details were described, Breivik could sometimes be seen frantically writing notes; at other times, he looked flustered.

Legal experts said the detailing of his crimes was intended to provide a final, graphic reminder of his actions, should he ever appeal to be released.

One of the judges, Arne Lyng, revealed that the 950kg fertiliser bomb Breivik detonated outside the government headquarters could have been significantly more devastating. "It was pure luck that not many more were killed," he said.

The killer refused to express remorse, arguing that his victims were brainwashed "cultural Marxists" whose political activism would adulterate pure Norwegian blood, and stating that he would commit his attacks again.

The court's verdict signalled closure for Norway in another way: its finding of sanity means that Breivik will not appeal against his jail term. Geir Lippestad, his lawyer, was unequivocal: "He told me he will accept this verdict."

As the hearing continued, some felt the mood of the proceedings tangibly lift as it sank home that it might be Breivik's last public appearance.

Ali Esbati, Swedish survivor on Utøya remarked that the courtoom did not feel as "oppressive" as it usually had throughout the 10-week trial.

"Many must feel that today marks a certain end to the process," he said.

• This article was amended on 28 August 2012. The original referred to Arne Lyng and Ali Esbati as "she" rather than "he". This has been corrected.