Two days after the fatal arc attack that left five dead in Norway, a court ordered the alleged perpetrator to be held in custody for four weeks in a medical facility.

In the first two weeks, Espen Andersen B. will be isolated for safety reasons, judge Ann Mikalsen decided on Friday.

The police now assume a mental illness as the background to the crime.

Prosecutor Ann Iren Svane Mathiassen had previously announced that the 37-year-old Dane had been handed over to the health services on Thursday evening.

The investigators had initially spoken of a presumably Islamistically motivated "terrorist act", but had not ruled out the attacker's mental illness.

Since then, doubts about the mental health and thus about the guilty responsibility of the attacker have increased.

The review could take months

"The strongest hypothesis after the first days of the investigation is that an illness is the background (of the fact)," said police commissioner Thomas Omholt on Friday in front of journalists. However, other motives are still not ruled out. The investigators continued to investigate whether the perpetrator could also have been driven by "anger, vengeance, impulsiveness, jihad" or "provocation," said Omholt.

The attacker shot Kongsberg with a bow and arrow in several places in his home on Wednesday evening, including in a supermarket. He killed four women and a man between the ages of 50 and 70 and injured three other people. The suspect was arrested about half an hour after the crime. According to the police, he admitted the crime, but did not admit his guilt. B's psychiatric assessment could take several months.

The alleged perpetrator is known to the secret service.

According to media reports, two judgments have already been made against B .: Last year he was banned from visiting his parents because of a death threat against his father, and in 2012 he was convicted of breaking into and buying hashish.

The investigators said on Thursday that B., who had converted to Islam, was known to the police as a potentially radicalized Muslim.

Norwegian media found a 2017 video of the attacker professing Islam and issuing a "warning".

A neighbor described B. as an unfriendly person who was always "alone".

“No smile, nothing on the face.

He just stared straight ahead, ”he told the AFP news agency.

"I'm completely shattered"

The residents of Kongsberg were still shaken by the events on Friday.

Mourners laid flowers and lit candles at the crime scenes.

The new Prime Minister Jonas Gahr Störe also came to the small town.

"I'm completely shattered.

I'll never get over that, ”said the 75-year-old pensioner Svein Westad, who lost two neighbors and friends in the attack.

"You should have caught him immediately," he said, taking up the criticism that had recently been raised against the police, who arrested the attacker half an hour after the first emergency call.

The federal government expressed its condolences to the survivors of the victims.

Chancellor Angela Merkel (CDU) and the entire federal government were "shocked by the brutal act of violence," said a government spokeswoman in Berlin.

For many Norwegians, the Kongsberg attack also brought back gloomy memories of the attacks by right-wing extremist Anders Behring Breivik in Oslo and Utöya a good ten years ago.

Behring killed eight people with a bomb on July 22, 2011 in the government district of the Norwegian capital.

He then crossed to the island of Utöya and shot 69 people there, most of them participants in a summer camp for young people organized by the Labor Party.