Seven of Sonboly's victims, who were aged 13 to 45, were teenagers. Witnesses spoke of the gunman opening fire on children who had just sat down to eat in a branch of McDonald's.
In a post on a chatroom website, which has since been taken down, a former classmate wrote of how schoolchildren would harass Sonboly, who killed himself after the shooting on Friday.
“I know this f****** guy, his name is Ali Sonboly," they wrote, "he was in my class back than (sic). We always mobbed him in school, and he always told us that he would kill us.”
The 18-year-old was obsessed with computer games including Call of Duty and used the monikers “Psycho” and “God Like” on his online profiles.
A 14-year-old girl who lived in the same block of flats as Sonboly said the teenager "was not popular at school, he only had two or three friends that he would hang out with," the Daily Mail reported.
Months before the shooting, Sonboly got into an argument and according to the girl: "He said he wanted to carry out a massacre. He said: 'I will kill you all.'"
Prosecutors said the teenager was suffering from mental illness and had received psychiatric treatment in the months leading up to the killing spree.
Another schoolmate said Sonboly was frequently "bullied by others" and was "really unpopular", The Guardian reported.
“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," they said.
The details emerged after a video was posted online showing a man armed with a gun, believed to be Sonboly, arguing with another man standing on a balcony during the shootings on Friday.
At the time when the video was made, Sonboly is believed to have already carried out the majority of the killings.
In the video, the gunman claimed he had been tormented for years prior to the attack.
“Because of you I was bullied for seven years ... and now I have to buy a gun to shoot you,” he says.
During the exchange the man on the balcony shouts “f***ing foreigner” at Sonboly, to which he replies “I am German... yeah, I was born here."
One 14-year-old who was friends with Sonboly's brother told MailOnline: "All he would do all day is play the shooting games. He was obsessed with them and wanted to be the best. He would go online for hours and play Call of Duty."
Munich police chief, Hurbertus Andrae, said Sonboly had a fascination with the neo-Nazi Anders Breivik, who murdered 77 people in a killing spree in Oslo. The Munich shootings occurred on the fifth anniversary of the Norway massacre.
“[He] was obsessed with shooting rampages,” Mr Andrae said. A search of the gunman’s parents' house found newspaper clippings relating to mass killings. One book, Why Kids Kill: Inside the Minds of School Shooters was among them.
According to German newspaper, Bild, Sonboly used a photograph of the Oslo killer's face as his Whatsapp profile picture.
Germany's Chancellor, Angela Merkel, said the country “mourned with a heavy heart“. She added: "A night like this is difficult for us all to bear.”
Register for free to continue reading
Registration is a free and easy way to support our truly independent journalism
By registering, you will also enjoy limited access to Premium articles, exclusive newsletters, commenting, and virtual events with our leading journalists
Already have an account? sign in
Join our new commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies