German officials investigating the 18-year-old man who killed nine people and injured 27 others in a shooting rampage in Munich on Friday evening, have linked the violence to the far-right Norwegian mass murderer Anders Breivik. Officials have also ruled out any ties to the Islamic State group.

"The link is obvious," Munich police chief Hubertus Andrae said at a press conference, describing the gunman as obsessed with mass killings.

Andrae added that the shooter, who later killed himself, researched the theme of rampages, had documents relating to past violent incidents and may have researched Breivik's lethal killing spree.

Friday's carnage came on the fifth anniversary of right-wing fanatic Breivik's massacre in Norway that killed 77 people, many of them youngsters.

Breivik is serving a maximum 21-year sentence — which can be extended if he is still considered dangerous — for killing eight people in a bombing outside a government building in Oslo and then gunning down another 69, most of them teenagers, at a Labour Youth camp on the island of Utoya on July 22, 2011.

Andrae said there were "no indications whatsoever" the 18-year-old German-Iranian gunman had any links to Islamic State group or that the killings were motivated by politics.

The Munich prosecutor also said the suspect — whose name has been withheld for the time being — had suffered depression and reportedly undergone psychiatric treatment.