A Norwegian court has ruled that gunman Anders Behring Breivik was sane when he killed 77 people last summer.

Breivik will be sent to jail for at least 21 years as the prosecution's request for an insane verdict was dismissed.

His release can be put off indefinitely should he still pose a threat to society.

Prosecutors had demanded a verdict of insanity, a fate Breivik called "worse than death", while many of his victims say only a sane person could have carried out such a complex attack.

Breivik detonated a fertiliser bomb outside a government building that included the prime ministerial offices last July, killing eight.

He then gunned down 69 people, mostly teenagers, at the ruling Labour Party's youth camp on Utoeya island.

Guilt had never been a question in the trial as Breivik described in chilling detail how he hunted down his victims, some as young as 14, with a shot to the body then one or more bullets to the head.

At the end of the hearing, Breivik was given an opportunity to speak and said that appealing the judgment would "legitimise" the court.

He said: "Since I don't recognise the authority of the court I cannot legitimise the Oslo district court by accepting the verdict.

"At the same time I cannot appeal the verdict, because by appealing it I would legitimise the court."

Breivik then said he wanted to issue an apology, but it was not for the victims.

"I wish to apologise to all militant nationalists that I wasn't able to execute more," he said.

His microphone was cut off as Judge Wenche Elisabeth Arntzen reprimanded him for his comment.

The killings shocked the nation of 5m people, which had prided itself as a safe haven from much of the world's troubles.

It also raised questions about the prevalence of far-right views as immigration rises.

Breivik himself argued for a verdict of sanity as he wants the attack to be seen as a political statement rather than an act of lunacy.

The courtroom heard today, a dispassionate yet chilling account of how the 77 victims died, either as a result of the bomb blast outside the government building, or as a result of the shooting rampage on Utoeya island.

The court heard how Breivik discovered through his car radio, that the 750kg bomb he had detonated had not caused the collapse of the building.

He had deemed this a failure, prompting him to proceed with greater determination to the island.

One of the panel of five judges delivered a long and chilling litany of the murders of 69 people on the island.

Most of those killed were teenagers, the court heard who they were, when they were born and how they died.

At one point, Breivik shot dead 15 people in six minutes.

Most were shot several times, and most sustained at least one gun shot to the head at point blank range.

Throughout the horrifying recital Breivik sat in the courtroom betraying not a single trace of emotion.

Breivik will be kept in isolation inside Ila Prison on the outskirts of Oslo.

His relatively spacious quarters include a separate exercise room, a computer and a television.