A 37-year-old Danish citizen, who was living in Norway, has been arrested and charged over the attack in the town of Kongsberg which left four women and a man dead.
He has been named and pictured by Norwegian media as Espen Andersen Brathen.
Norway's national security agency said the suspect's actions "currently appear to be an act of terrorism".
In a video on his Facebook, which Norwegian media said was flagged to police in 2017, Bråthen said in English: “Hello. I’m a messenger. I come with a warning. Is this really what you want? And for all who want to make up for themselves, so it’s time. Bear witness that I am a Muslim.”
Regional police chief Ole Bredrup Saeverud told a news conference on Thursday that police officers had been in contact with the suspect amid fears over his radicalisation. He remains in police custody and is believed to have acted alone.
Norway’s domestic security agency, known by its acronym PST, cited various aspects of the attack, that also wounded two people, in explaining its belief that the suspect’s actions “currently appear to be an act of terrorism”.
“Attacks on random people in public places are a recurring modus operandi among extremist Islamists carrying out terror in the West,” the domestic security agency said.
The agency said that “the most probable scenario of an extremely Islamist terrorist attack in Norway is an attack carried out by one or a few perpetrators with simple weapon types, against targets with few or no security measures”.
It added that the suspect “is known to PST from before, without PST being able to provide further details about him”.
“The investigation will clarify in more detail what the incidents were motivated by,” the PST said in a statement.
Two people, including an off-duty police officer, were wounded and rushed to intensive care after the Wednesday evening attacks which took place in different locations in the town, 42 miles southwest of the capital, Oslo.
Mr Saeverud told reporters that the victims were four women and one male, aged between 50 and 70.
"This very serious situation is of course making a deep impression on Kongsberg and those who live here," district police chief Oeyvind Aas said in a statement.
Several of the attacks were committed with a bow and arrow, Aas said late on Wednesday, though police were also investigating whether other weapons were used.
The death toll was the worst of any attack in Norway since 2011, when far-right extremist Anders Behring Breivik killed 77 people, most of them teenagers at a youth camp.
The police said they were giving information on the man's nationality after rumours swirled on social media about people not linked to the attacks.
Norway's incoming prime minister, Jonas Gahr Stoere, who is due to take power on Thursday after winning a general election last month, said he had been kept informed by the outgoing government.
"What we've learned from Kongsberg bears witness of a gruesome and brutal act," Stoere said in a statement to news agency NTB.
The attacks went on for more than half an hour over a "large area" of Kongsberg, including at a Coop Extra grocery store, the Aftenposten newspaper cited police as saying.
A woman living near the store said she had heard alarms as she was walking home.
"I saw a group of police officers, including one who held several arrows in his hand," the woman, Marit Hoefle, told the newspaper.
Investigators are considering whether the attacks amounted to an act of terrorism and said they would give more details of the incident later on Thursday.
Police were interrogating the suspect and he was cooperating, his defence lawyer said. He has not yet entered a plea.
“He is admitting to the facts of the case,” police attorney Ann Iren Svane Mathiassen told news agency NTB.
“We’ll have to see if he also pleads guilty,” she later told private broadcaster TV2.
Images from one of the crime scenes showed an arrow that appeared to be stuck in the wall of a wood-panelled building.
About 28,000 people live in the Kongsberg municipality.
Norway’s royal family expressed its sympathies.
“We’re horrified by the tragic events at Kongsberg,” King Harald said in a letter addressed to the town’s mayor.
“The rest of the nation stands with you,” the 84-year-old monarch added.