Two Danish sources close to the investigation confirmed to the AP that the slain gunman was named Omar Abdel Hamid El-Hussein. The sources spoke on condition of anonymity because Copenhagen police have not named the gunman, who they said was a 22-year-old Dane.
Several Danish media have already named him.
One source said that El-Hussein had been in pre-trial detention for a long time but was released two weeks ago. He also said the corrections authority had alerted Danish security service PET last year after they noticed worrisome changes in El-Hussein's behavior. He wouldn't elaborate.
The news about the suspected gunman came as Danes mourned the two victims of the country's first fatal terror attacks in 30 years - and, in an unusual development, some also put flowers at the spot where police killed El-Hussein.
While Danish court today jailed two suspected accomplices of El-Hussein's for 10 days, the prime minister insisted there were no signs the gunman had any links to a wider terror network.