A Copenhagen court on Monday remanded into a psychiatric care facility the 22-year-old suspect accused of shooting dead three people in a shopping mall at the weekend, police said.
"The court remands the 22-year-old in a closed psychiatric ward," Copenhagen police wrote on Twitter, following a two-hour hearing involving the suspect.
Danish police said earlier on Monday the suspect was known to mental health services.
"Our suspect is also known among psychiatric services, beyond that I do not wish to comment," Copenhagen police chief Soren Thomassen told a press conference.
Thomassen added that the victims appeared to have been randomly targeted and there was nothing to indicate it was an act of terror.
"Our assessment is that the victims were random, that it isn't motivated by gender or something else," Thomassen said.
The police chief could not yet comment on a motive, but said there seemed to have been preparation ahead of the attack and that the 22-year-old suspect was not aided by anyone else.
"As things stand, it seems he was acting alone," he said.
The three killed have been identified as a Danish teenage girl and boy, both aged 17, and a 47-year-old Russian citizen residing in Denmark.
Another four were injured in the shooting: two Danish women, aged 19 and 40, and two Swedish citizens, a 50-year-old man and a 16-year-old woman.
Police confirmed that the suspected shooter was present at the mall at the time of the shooting and is known to the police "but only peripherally".
They added that they believe videos of the suspect circulating since Sunday evening on social media to be authentic.
In some of the images, the young man can be seen posing with weapons, mimicking suicide gestures and talking about psychiatric medication "that does not work".
YouTube and Instagram accounts believed to belong to the suspect were closed overnight, AFP noted.
The shooting occurred Sunday afternoon at the busy Fields shopping mall, located between the city centre and Copenhagen airport.
According to police, the shooter was armed with a rifle, a pistol and a knife, and while the guns were not believed to be illegal, the suspect did not have a license for them.
Witnesses quoted by the Danish media described how the suspect had tried to trick people by saying his weapon was fake to get them to approach.
"He was sufficiently psychopathic to go and hunt people, but he wasn't running," one witness told public broadcaster DR.
Other eyewitnesses told Danish media they had seen more than 100 people rush towards the mall's exit as the first shots were fired.
Prime Minister Mette Frederiksen denounce the "cruel attack" in a statement late Sunday.
"Our beautiful and usually so safe capital was changed in a split second," she said.
The shooting came just over a week after a gunman opened fire near a gay bar in Oslo in neighbouring Norway, killing two people and wounding 21 others.
In February of 2015, two people were killed and five injured in Copenhagen in a series of Islamist-motivated shootings.
(FRANCE 24 with AP, AFP and REUTERS)