The man suspected of killing five people with a bow and arrows in Norway is being kept in a secure psychiatric institution for mental health checks.
A court ruled that Espen Andersen Brathen, a 37-year-old Danish citizen and Muslim convert, could be kept for four weeks in pre-trial detention.
Investigators say he has confessed to Wednesday's deadly attack in Kongsberg, a town 68km (43 miles) west of the capital Oslo.
The attack killed four women and a man.
The victims, apparently targeted at random, were aged between 50 and 70. Three others, including an off-duty police officer, were wounded.
"The hypothesis that has been strengthened the most in the first days of the investigation is that the background is illness," said police inspector Per Thomas Omholt.
If psychiatrists determine that he is mentally ill, he could be confined to psychiatric care rather than face a possible prison term.
Norway's PST security service learnt in 2015 that Brathen had become a Muslim and was "a vulnerable person who could be about to be radicalised", PST counter-terrorism chief Arne Christian Haugstoyl told public broadcaster NRK.
In 2017 police questioned Brathen after he had posted a video on YouTube, where he said he was a "messenger" and "Muslim", but they concluded that he was not an extremist, Mr Haugstoyl said.
"Based on his mental challenges and low threshold for committing violence, we thought it was possible that he could carry out low-scale attacks, with simple means," Mr Haugstoyl said.
The bow and arrow attack was first reported at 18:13 (16:13 GMT) on Wednesday. Police confronted the man six minutes later, but he shot several arrows at them and escaped. He was eventually caught about 30 minutes later. The killings happened during that time, police said.
Brathen had a previous conviction and a restraining order for threatening to kill a relative.
Residents have been deeply shaken by the violence, which unfolded across several locations including a supermarket.
Flags were flown at half-mast on Thursday while flowers and other memorials were placed in Kongsberg's main square.
Police fired warning shots when he was eventually arrested, but it is not clear if officers were armed when they first came across the suspect. Norwegian police do not usually carry guns on them - weapons are stored at police stations or in their patrol cars.
The attack was Norway's deadliest since far-right extremist Anders Behring Breivik murdered 77 people, most of them teenagers, on the island of Utoya in July 2011.
'The atmosphere here has darkened'
Kongsberg Mayor Kari Anne Sand said it was a shocking attack in an area where many people lived, and that a crisis team would help anyone affected.
Describing the town as "a completely ordinary community with completely ordinary people", Ms Sand said everyone had been deeply shaken by "this very tragic situation".
British woman Fiona Herland, who has lived in Kongsberg for five years, described the town as "a very warm, cosy place - nothing happens here."
"This is absolutely devastating. You can feel the atmosphere here has darkened," she told the BBC.
The suspect had a Danish mother and Norwegian father, police said. Denmark's Prime Minister Mette Frederiksen said Danish authorities would work with Norway on the investigation.
The attack came on the final day of then-Prime Minister Erna Solberg's conservative government. On Thursday morning, Labour leader Jonas Gahr Store became Norway's new prime minister with a centre-left coalition.
Bows and arrows are not classed as illegal weapons in Norway. Buying and owning them is permitted, and owners are not required to register them, although they must be used at designated archery ranges.
After the attack, police officers nationwide were ordered to carry firearms as an extra precaution, but there is "no indication so far that there is a change in the national threat level," the directorate said in a statement (in Norwegian).