The teenage gunman who killed nine people in Munich on Friday had been planning his attack for a year, German authorities say.
David Sonboly, 18, who had a Glock pistol and more than 300 bullets, killed himself after the attack.
The Bavarian State Crime Office said he had bought the illegal pistol used in the attack on the internet.
Vigils continue in the Bavarian capital to commemorate the victims, seven of whom were teenagers.
A further 35 people were injured.
The crime office told a news conference that the victims of the attack had not been specifically targeted and were not classmates of the gunman.
Robert Heimberger, head of Bavaria’s criminal police, said Sonboly had paid a visit last year to the town of Winnenden – the scene of a previous school shooting in 2009 – and took photographs.
Mr Heimberger added that the parents of the gunman remained in shock and were not able to be interviewed.
He said it was likely the Glock pistol – which had been reactivated – was bought on the “dark net” market.
He also said that Sonboly was a keen player of “first-person shooter” video games.
The news conference also heard that Sonboly had spent two months as an inpatient at a mental care facility in 2015 and was afterwards treated as an outpatient.
Thomas Steinkraus-Koch, spokesman for the Munich prosecutor’s office, told the briefing there was no evidence of any political motivation.
Senior German politicians have called for tighter controls on the sale of guns in the wake of the shooting at the Olympia shopping centre.
Munich’s police chief has urged the media to respect the privacy of those affected by the attack on Monday, when schools reopen.