Omar Abdel Hamid El-Hussein, the gunmen suspected of killing two people in Copenhagen over the weekend, allegedly swore allegiance to Islamic State leader Abu Bakr al-Baghdadi, CNN reported on Tuesdays.
In a post on what is apparently el-Hussein's Facebook page just before the shooting spree in the Danish capital, he pledges "allegiance to Abu Bakr in full obedience in the good and bad things. And I won't dispute with him unless it is an outrageous disbelief."
El-Hussein, 22, who was identified as the gunmen by a senior Danish government member, was killed in a shootout with police early Sunday morning.
He had opened fire Saturday at a cultural center hosting a seminar on free speech with an artist who had caricatured the Prophet Muhammad and then later at security forces outside a synagogue, police said.
A Danish filmmaker was killed in the first attack. Nine hours later, a security guard protecting a bat mitzvah near a synagogue was slain. Five police officers were wounded in the shootings.
The suspect shooter was known to police precisely because of his connections to gangs. El-Hussein was convicted two months ago of a violent assault against a commuter on a train in 2013, and was said to have been released from prison just two weeks ago after serving a term for aggravated assault - raising fears he may have become radicalized behind bars.
Local media said he was the son of Palestinian immigrants who argued aggressively about the Israel-Palestinian conflict, had a short fuse, but had not shown signs of radicalization that could lead to an attack.
Jens Madsen, head of the Danish intelligence agency PET, said investigators believe the gunman "could have been inspired by the events in Paris." Last month Islamic militants carried out a massacre at the French satirical newspaper Charlie Hebdo followed by an attack on Jews at a kosher grocery, killing 17 people.
"He could also have been inspired by material sent out by (the Islamic State group) and others," Madsen said.
Copenhagen police made no mention of Islamic extremism and said the Danish-born suspect had a history of violence and weapons offenses and connections to a criminal gang. They didn't release his name.
Dozens of bouquets of flowers were left outside a building in the neighbourhood of Noerrebro where El-Hussein was shot dead on Monday.
Four young men wearing hooded tops and with their faces covered later came to move the bouquets, saying it was un-Islamic to leave flowers for deaths.
They said they were from Mjoelerparken, the same area as El-Hussein, where many residents are immigrants.
One of the men, identifying himself only as Mohammed, said: "He was a good guy. He wasn't a terrorist. It's Denmark, the United States and Israel who are the terrorists."
On Monday, two suspects were charged with helping the gunman dispose of his weapon and giving him somewhere to hide.
"The two men are charged with helping through advice and deeds the perpetrator in relation to the shootings at Krudttonden and in Krystalgade," the police said in a statement, referring to the location of the two attacks.
Reuters and AFP contributed to this report.