Copenhagen shootings
Copenhagen police shot dead a man they believe was responsible for two earlier fatal shootings at a cafe and synagogue Reuters/Martin Sylvest/Scanpix Denmark

Danish police have identified the gunman who shot and killed two people in Copenhagen before being shot dead by police.

Danish media have named the suspect as 22-year-old Omar El-Hussein, a man police say was born in Denmark and had a criminal record which included convictions for violence and weapons offences.

Ekstra-Bladet, a Danish tabloid, reported that he was released from jail only two weeks ago after serving a term for aggravated assault.

El-Hussein was wanted by police in November 2013 for stabbing a fellow passenger on a train, according to Ekstra-Bladet.

The head of the country's security service Jens Madsen said it was possible that the suspect was "inspired by militant Islamist propaganda issued by IS [Islamic State] and other terror organisations."

El-Hussein is thought to have been attempting to copy the Charlie Hebdo attacks and had drawn the attention of the police, who were apparently monitoring the suspect's flat shortly before an exchange of gunfire at the train station in which he was killed.

Police have recovered a weapon used in the first attack. Two people were arrested at an internet cafe near where the suspect was shot dead.

It has also been disclosed that the man who was shot dead at the Krudttoenden cafe was documentary filmmaker Finn Noergaard.