According to eyewitness reports the shooter was out of control. A friend of his tried to stop him, unsuccessfully.
Via AFP:
A shooting outside a Copenhagen mosque killed one person and wounded another Tuesday as Pakistani worshippers were celebrating the end of the fasting month of Ramadan, police said.
"I can confirm that one person has been killed and another wounded," Copenhagen Police Chief Inspector Lau Thygesen told national daily B.T.
"The incident is related to the people who were present in the mosque, but not necessarily anything to do with the mosque or prayers. It is probably an internal dispute between people of Pakistani origin," Thygesen told another national daily, Politiken.(source)