A Norway court has sentenced a Danish man to full-time psychiatric care after he pleaded guilty to stabbing five people to death and shooting a bow and arrow in an attack last year.

Espen Andersen Brathen, who is Danish but lives in Norway, used a bow and arrow inside and outside a supermarket to attack several people before stabbing to death five other residents in their homes or on the street while spreading terror through the normally peaceful southeastern town of Kongsberg in October.

Last month, the 38-year-old who has long-suffered from mental illness, pleaded guilty to the charges of murder and attempted murder.

In their verdict, the judges said "the defendant clearly had comprehension and functional disorders because of his condition" at the time of the attack.

"The court therefore finds that the defendant cannot be held criminally responsible for any of the charges," the verdict said.

Three students of artist Hanne Merethe Englund, who was one of the 5 victims, lay flowers at her house

Brathen had been living for years in Kongsberg, home to about 25,000 people some 80km west of the capital Oslo, and authorities have said he had a medical history.

The Norwegian security services PST, which are responsible for counter-terrorism, also said the man had been on their radar.

He was arrested 35 minutes after the first reports of an attack and was moved to a medical institution.

Three experts who observed him concluded that he was suffering from paranoid schizophrenia.

Both the prosecution and the defence argued that he could not be held criminally responsible and advocated a psychiatric commitment rather than a prison sentence.

According to the prosecution, Brathen was armed with a bow, 60 arrows and four knives on the day of the attacks.

His victims were four women and one man aged from 52 to 78.