Two men suspected of helping the gunman behind the deadly attacks in Copenhagen are being held in jail for 10 days as Danes mourn the victims of a shooting spree thought to have been inspired by the Paris terror attacks.

The pair are accused of helping the gunman evade authorities and getting rid of a weapon during the manhunt in the Danish capital that ended on Sunday when the attacker was killed in a shoot-out with police.

Prosecutors had asked a judge to place the pair in solitary confinement for four weeks, and the relatively short period of detention suggests the case against the men is "thin," according to Anders Rohde, an assistant of Michael Juul Eriksen, the defence lawyer for one of the suspects.

Mr Rohde spoke to reporters after a four-hour custody hearing held behind closed doors for the men, who were not named.

Two people were killed in the weekend attacks, including a Danish filmmaker attending a free speech event and a Jewish security guard shot in the head outside a synagogue in Copenhagen. Five police officers were also wounded in the attacks.

Authorities have not identified the gunman, but have described him as a 22-year-old Dane with a history of violence and gang connections.

Denmark's security services said he may have been inspired by the terror attacks by Islamic extremists in Paris that killed 17 people last month.

Denmark's red-and-white flag flew at half-staff from official buildings across the capital.

Mourners placed flowers and candles at the cultural centre where documentary filmmaker Finn Noergaard, 55, was killed, and at the synagogue where Dan Uzan, a 37-year-old security guard, was gunned down.

There was also a smaller mound of flowers on the street at the location where the gunman was slain.

The prime ministers of Denmark and Sweden are expected to join thousands of people at memorials in Copenhagen on Monday evening.

Denmark has been targeted by a series of foiled terror plots since the 2005 publication of 12 caricatures of the Prophet Muhammad in the newspaper Jyllands-Posten. The cartoons triggered riots in many Muslim countries and militant Islamists called for vengeance.

One of the participants in the free speech event targeted on Saturday was Swedish artist Lars Vilks, who caricatured the prophet in 2007. Mr Vilks, who was whisked away by his bodyguards and was unharmed, told reporters he thought he was the intended target of the attack.

Other participants said they dropped to the floor, looking for places to hide as the shooting started. The gunman did not enter the cultural centre, but sprayed it with bullets from outside during a gun battle with police.

World leaders, including David Cameron, German chancellor Angela Merkel and UN secretary-general Ban Ki-moon, have united in condemnation of the Copenhagen attacks.

French president Francois Hollande visited the Danish embassy in Paris, while Parisian mayor Anne Hidalgo appeared in Copenhagen in a show of solidarity.

"The terrorist attacks have the same causes in Paris and Copenhagen," Ms Hidalgo said.

"Our cities are symbols of democracy, Paris and Copenhagen. We are here and we are not afraid."

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.