A German-Iranian teenager who shot dead nine people in Munich was a deranged lone gunman obsessed with mass killings who drew no inspiration from Islamist militancy, police said today.

The 18-year-old, born and raised locally, opened fire near a busy shopping mall yesterday evening, triggering a lockdown in the Bavarian state capital.

Nine people died and 27 were wounded in the attack. The gunman then took his own life.

Seven of his victims were themselves teenagers, who police said he may have lured to their deaths via a hacked Facebook account.

The attack took place on the fifth anniversary of twin attacks by Norwegian mass murderer Anders Breivik that killed 77 people.

Breivik killed eight people with a bomb in Oslo and then gunned down 69 people at a gathering on an island nearby in 2011.

Bavarian state crime office president Robert Heimberger said the gunman, who German media named as Ali David Sonboly, was carrying more than 300 bullets in his backpack and pistol when he was later found dead of a gunshot wound.

Following a police search of the attacker's room, where a book on teenage shooting sprees was discovered, Munich police chief Hubertus Andrae all but ruled out an Islamist militant link in the attack.

We need your consent to load this rte-player contentWe use rte-player to manage extra content that can set cookies on your device and collect data about your activity. Please review their details and accept them to load the content.Manage Preferences

"Based on the searches, there are no indications whatsoever that there is a connection to Islamic State" or to the issue of refugees, Chief Andrae told a news conference.

"Documents on shooting sprees were found, so the perpetrator obviously researched this subject intensively."

The gunman was born and brought up in the Munich area and had spent time in psychiatric care, and there was no evidence to suggest he had had an accomplice, Chief Andrae said.

Interior Minister Thomas de Maiziere said it was also too early to associate the Munich shootings with Breivik. 

Mr Heimberger told the news conference police were investigating findings suggesting the Munich gunman invited people to a fast food restaurant at the mall via a hacked Facebook account.

"(He) said he would treat them to what they wanted as long as it wasn't too expensive - that was the invitation," Mr Heimberger said. He added that this still needed to be verified, but there were many clues suggesting the attacker had set up the invitation and sent it or posted it online.

Munich suffers 'night of horror'

Chancellor Angela Merkel said "the people of Munich have come through a night of horror", adding that "a night like this is difficult for us all to bear".

She said she was mourning those killed and vowed that the security services would do everything to ensure the public was safe.

"We are all - and I'm saying this on behalf of the whole federal government - mourning with a heavy heart for those who will never return to their families," Ms Merkel said.

She added: "To the families, the parents and children for whom everything today seems empty and pointless, I say personally and in the name of many, many people in Germany: we share your pain, we're thinking of you and we're suffering with you."

Police, citing witnesses, had initially said they were looking for up to three suspects and were treating the incident as a suspected terrorist attack.

Munich went into lockdown with transport halted and highways sealed off immediately after the attack.

It was the third major act of violence against civilians in Europe in eight days.

Previous attacks in France and Germany were claimed by IS.

Police commandos raided an apartment in the Munich neighbourhood of Maxvorstadt early this morning where the German newspaper Bild said the gunman lived with his parents.

President Michael D Higgins said he had spoken to German Ambassador to Ireland HE Matthias Höpfner.

He said: "The taking of innocent lives in a peaceful European city affects all Europeans, including the Irish people, and as fellow Europeans committed to peace, we must not let this attack undermine the way of life of those who value democracy."

In a statement, Taoiseach Enda Kenny said that "Europe's values of freedom" had been attacked once again.

He said: "As Irish people and Europeans we stand in solidarity with Chancellor Merkel and Germany, as we did with France, at this difficult time for our shared Union."

Minister for Foreign Affairs Charlie Flanagan said his department was not aware of any Irish citizens caught up in the situation but officials were in close contact with the Irish Embassy in Berlin.

Fianna Fáil leader Micheál Martin said it was "difficult to find the words to describe this horrific and heedless attack".

British Foreign Secretary Boris Johnson expressed his sadness at the attack.

French President Francois Hollande said Germany can count on France's friendship and co-operation.

US President Barack Obama said Germany is one of America's closest allies and pledged support for Germany.