The 22-year-old Danish male, accused of opening fire on Sunday afternoon on shoppers in the Field's mall a few kilometres south of downtown Copenhagen, was arrested and charged with manslaughter and intent to kill.
He was remanded into custody for 24 days and will undergo a psychiatric evaluation, authorities said. The court has barred publication of his name, which is common in criminal cases in Denmark.
The incident shocked Denmark at the end of an otherwise festive week in which it hosted the first three stages of the Tour de France cycle race and hundreds of thousands of cheering Danes took to the streets across the country.
The shooter killed two 17-year-olds and a 47-year-old. Seven other people were wounded with gunshots, four with serious injuries, including a 16-year-old girl. Twenty people received other injuries fleeing the scene.
The incident could not be viewed as an "act of terror" based on current evidence, Chief Police Inspector Soren Thomassen told reporters, adding there was no indication the suspect had acted together with others.
"There has been some sort of deliberation and preparation (by the suspect) up to this terrible event," Thomassen told a news conference without providing details on the perpetrator's possible motives.
"Our current assessment is that these are random victims."
The attack took place when many young people were visiting the mall ahead of a concert due to be held nearby by British singer Harry Styles. The concert was cancelled.
"I'm heartbroken along with the people of Copenhagen. I adore this city. The people are so warm and full of love. I'm devastated for the victims, their families, and everyone hurting," Styles wrote on Twitter. "I'm sorry we couldn't be together. Please look after each other."
The suspect, who police said was known to psychiatrists in Denmark, was in possession of a rifle, ammunition and a knife when he was arrested.
Danish gun laws are strict and all firearms, with the exception of some hunting rifles, require a licence issued by the police. The shooter did not have such a licence.
Denmark's largest cinema operator Nordisk Film, which has a venue at the Field's shopping centre, said it had decided to close its theaters across the country on Monday due to the shooting.