Danish police have charged two people with aiding the man suspected of shooting dead two people in attacks in Copenhagen at the weekend.

The two men were charged after being arrested on Sunday following attacks on a synagogue in Krystalgade and a free-speech event in Krudttoenden.

"The two men are charged with helping through advice and deeds the perpetrator in relation to the shootings at Krudttoenden and in Krystalgade," the police said in a statement on Monday, referring to the attacker who was shot dead by the police hours after the twin attacks.

The police had no further comment.

Earlier, police said the man they shot dead on Sunday was a Danish-born 22-year-old with a background in criminal gangs. Investigators said the suspect had a history of assault and weapons offences.

In the two Copenhagen attacks, one man was killed and two police officers wounded at the synagogue, while one man was killed and three police officers were wounded in an attack on a cafe in the north of the capital.

Denmark's Jewish Community identified the victim at the synagogue as 37-year-old Jewish man Dan Uzan, who was guarding a building during a bar mitzvah when he was shot dead at about 1am local time on Sunday morning.

The earlier shooting occurred before 4pm local time on Saturday when police said a gunman used an automatic weapon to shoot through the windows of the Krudttoenden Cafe during a panel discussion on freedom of expression.

The debate on freedom of speech was attended by Lars Vilks, a Swedish artist who had been threatened with death for his cartoons of Prophet Muhammad.

Vilks was whisked away unharmed by his bodyguards.

Source: Al Jazeera and agencies