THE teenage student who murdered nine people in Munich had an obsession with mass shooting sprees, like the massacre five years to the day by the Norwegian right-wing fanatic Anders Breivik.

The killer has been named locally as 18-year-old Ali Sonboly. Searches of his flat and of an apartment believed to belong to his parents have unearthed a mass of newspaper clippings and books about this and other mass killings, one of which was a textbook called Why Kids Kill: Inside The Minds Of School Shooters.

Read more: Munich shopping centre attack: Gunman who murdered nine was a teenager acting alone, police say

Munich police chief Hubertus Andrae said there was an "obvious" link between the new attack and Friday's fifth anniversary of Breivik's attacks in Norway, when he murdered 77 young people.

However, while police don’t know precisely what triggered Sonboly they are sure that there was no clear political motivation, ruling out links to Islamic State, and to far-right groups. Investigators are now trying to find whether the apparent loner had co-conspirators and, crucially, how he was able to obtain – presumably from criminal sources – an illegal handgun and a huge cache of ammunition.

The Herald:

Sonboly did not have a criminal record and was not known to the police, but he was being treated for mental health problems, said to be depression. It has also emerged that he had been bullied at school. Eyewitnesses report that this was one of the claims he shouted out as fired and reloaded.

Classmates also confirm that he had been bullied at school, while neighbours described him as shy and lazy.

“At school, Ali was often bullied by others and really unpopular,” one classmate said. “He was a bit chubby, and he was either by himself or together with one or two people, but he seemed to have hardly any friends.”

Stephan Baumanns, owner of the Treemans bakery and coffee shop below Sonboly’s apartment, said: “I saw [Sonboly] every once in a while pass by, he was a very shy guy and tall, about 6ft 2in (1.88m). He wasn’t very sporty, rather a little chubby. He seemed like a lazy guy. He had a job distributing a free newspaper, Münchener Wochenblatt, but I often saw him rather than deliver them, throw them all away into the garbage bin.”

Read more: Munich shopping centre attack: Twitter users offer refuge to people stranded by shooting

The early presumption that this was an IS attack was first called into question when a short and shaky video clip from a camera phone was uploaded to the Internet. It showed the attacker, in front of the McDonald’s restaurant on Hanauer Street, firing off a fusillade of shots as people ran to get away.

Although it wasn’t possible to identify the gunman it seemed apparent that the man dressed in black combat fatigues was white-skinned. This immediately raised speculation that this was an attack, not by IS, but by a far-right group, which appeared to gain credibility when it was became apparent that it coincided with the anniversary of Breivik’s massacre in 2011.

The Herald: Masked police stand at a bus stop in front of the Olympia mall where the shooting took place in Munich (AP)

Sonboly murderous rampage had begun inside the fast-food restaurant. He had loaded an illegally-held Glock 17 pistol, the serial number filed off, in the male toilet before emerging to begin shooting at adults and children eating at tables. One eyewitness claims that he shouted Allahu Akbar as he opened fire.

Some of those eating there, some of the dead or wounded, may even have been lured there by the offer he posted on a Facebook account for free food. It came from a young woman’s account, either a fake one, or one that the 18-year-old had hacked into.

This was at 5.50pm local time. Police units were beginning to mobilise as reports came in but Sonboly still took time to move to the nearby Olympic Centre and unleash another killing spree, even going up to a flat roof to exchange a foul-mouth tirade with a man who hung out of a window in an adjoining flat and filmed the encounter. "I am German,” the killer shouted, in response to four-letter taunts, before firing four shots at the window.

Read more: Munich shopping centre attack: Gunman 'had no links to Islamic State'

By now nine people, some of them children, were dead and 16 others wounded. Somboly had come prepared for a lengthy rampage, he had more than 300 rounds of ammunition for the Glock in a red haversack – some reports say it had a Pokemon decal – strapped over his shoulders.

The Herald: German Chancellor Angela Merkel said the Munich attack was 'difficult to bear'

Police units were now flooding the area, plainclothes and uniformed officers carrying automatic weapons were running through the mall, around 2,300 officers in total were deployed on the city's streets and specialist counter-terror units were flown in. Police forces in neighbouring Austria and Switzerland also sent officers to assist.

The city was in lockdown, buses and trains had stopped and people were told by the authorities to get off the streets and stay inside, motorists were told to clear the roads so that emergency services could get through, doors were being opened to give refuge to those who were stranded. Locals offering safe havens used the hashtag #OffeneTur – or #OpenDoor – inviting people left stranded by the emergency response to stay.

Almost four hours after the horror began, at 9.30pm, Somboly’s body was found in a side street close to the shopping centre. He had been shot in the head, in an apparent suicide.

Police also confirmed the victims killed in the massacre included two 13-year-olds. They said they had not yet established whether young people had been deliberately targeted.

German Chancellor Angela Merkel said: "Nine people who were going shopping on the Friday evening, or wanted to eat something, they are now dead - it seems according to the investigations, hit and killed by the bullets of one single perpetrator."

The Chancellor said the operation between the agencies and security forces on Friday night was "seamless" and thanked them for their "phenomenal" effort. She added: "We are in deep and profound mourning for those who will never return to their families. The families, siblings, friends to whom everything will be void and empty today. I would like to tell them, in the name of many, many people in Germany, we share in your grief, we think of you and we are suffering with you.”

Meanwhile in Edinburgh, which is twinned with Munich, flags flew at half-mast yesterday as people in the Scottish captial paid their respects to the victims of the shooting.