Police spokesman Lau Thygesen said another person was injured in Tuesday's attack.
The incident happened outside the Muslim Culture Institute mosque in western Copenhagen after a prayer service marking Eid al-Fitr, the end of the Muslim fasting month of Ramadan.
"The incident is related to the people who were present in the mosque, but does not necessarily have anything to do with the mosque or prayers. It is probably an internal dispute between people of Pakistani origin," Thygesen told the newspaper Politiken.
Thygesen told Al Jazeera that the shooter escaped but police hoped to identify the attacker soon as there had been at least a hundred witnesses on the scene.
He said it could have been a gang showdown but that police was investigation all possible motives.
"There was an argument between two groups and afterwards there were a lot of shots fired," he said.
Danish broadcaster TV2 quoted witnesses saying they had seen shots fired from a car driving by as people were leaving the mosque.
Unconfirmed reports from witnesses said there was a violent scene before the shooting, with one man refusing to get into a vehicle, after which a pistol was drawn and shots fired.
"There was a disagreement between a group of young people and suddenly there were shots. I would say about 20 shots," Kuran Qureshi told TV2News.
"Everyone ran for cover and hid behind vehicles and whatever they could find. There were women
and children there too".
The shooter was caught. He's injured and at a hospital in southern Sweden. Two others have been arrested, but I can't find an English source, and I don't have the time to translate RN