A teenager arrested in connection with the deadly Munich shooting may have known about the attack before it happened, officials have said.
The 16-year-old Afghan appeared to have met with the gunman at the mall where the shooting took place before the attack and knew he had a pistol, police said.
Investigators said the two teenagers met last year as in-patients at a psychiatric ward, with both being treated for online game addictions, among other things.
A spokesman for the German Interior Ministry said there could be a link between video games and the shooting and that there should be a discussion about "violent" video games.
A friend of the Munich gunman has been arrested over suspicions that he knew of the attack plans but failed to report them.
The 16-year-old Afghan youth may also have played a role in creating a Facebook post encouraging people to gather at the city's train station, police said.
"There is a suspicion that the 16-year-old is a possible tacit accomplice to (Friday's) attack," police said in a statement.
Attacker David Sonboly, 18, killed nine and wounded 27 others in a rampage through the city before taking his own life.
He apparently plotted the attack for a year and is thought to have created a Facebook post offering free meals to teenagers at the McDonalds on the day of the shooting.
Video report by ITV News Security Editor Rohit Kachroo.
The teenage gunman who killed nine and wounded 27 others in a rampage in Munich had visited the site of a school mass shooting, it has emerged.
David Sonboly, 18, went to see the south German campus where a former student killed fifteen people in 2009.
It has added to the picture of a quiet and disturbed teenager who apparently plotted his attack for months in advance.
However police have stressed there is no evidence that the attack was terrorist.
A gunman who killed nine people during a shooting in Munich, Germany, had planned the attack for a year, the Bavaria state prosecutor's office has said.
A spokesman also said the victims of the shooting were not classmates of 18-year-old student David Ali Sonboly who has been identified as having carried out the attack.
The teenager is said to have been obsessed with mass shootings and is believed to have hacked a Facebook account in an attempt to lure people to a shopping mall where the attack took place.
The prosecutor's office also confirmed that a semi-automatic 9mm Glock handgun used in the attack was purchased on the internet illegally.
Authorities have not been able to interview the teenager's parents, the spokesman added.
Video report by ITV News' Security Editor Rohit Kachroo:
An 18-year-old gunman who killed nine people at a shopping centre in Munich was bullied at school and 'obsessed' with mass shootings.
The German-Iranian attacker, named in reports as Ali Sonboly, went on a solo killing spree at the Olympia shopping centre and a McDonald's restaurant in the Bavarian capital on Friday.
Born and raised in the German city, he murdered nine people and injured 27 others - 10 of whom are in a critical condition, including a 13-year-old boy.
Officials said the attacker was not known to them and had no criminal record. He had been in psychiatric care and was treated for depression. He later killed himself.
Three of the victims are believed to be from Kosovo, three from Turkey and one from Greece - seven of the dead are understood to be teenagers.
Flags in Edinburgh are flying at half mast in solidarity with its twin town Munich after nine people were killed by a gunman in the German city.
Edinburgh's Lord Provost Donald Wilson said: "On behalf of the citizens of Edinburgh, I offer our sincere condolences to the people of Munich and across Germany following yesterday's attack.
"Edinburgh has enjoyed a close relationship with Munich since becoming our very first twin city in 1954, so yesterday's events are particularly moving.
"Our thoughts are with the families of all those who have died and are injured."
"The flags flying above the Edinburgh City Chambers have been lowered to half mast as a mark of respect and support for all those affected."
Germany's Interior Minister Thomas de Maiziere has said it is too early to link the gunman who carried out the Munich shooting to Norway's mass killer Anders Breivik.
The 18-year-old gunman is said to have been obsessed with mass shootings and the attack took place on the fifth anniversary of Breivik's massacre of 77 people in 22 July 2011.
Mr de Maiziere said documents and internet data found to be related to the Munich shooter pointed to an interest in various shooting sprees,including that of Breivik.
German Chancellor Angela Merkel has said the country is "mourning with a heavy heart" after the Munich shooting attack.
"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."
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."
Nine people were killed when an 18-year-old gunman opened fire at a shopping centre and fast-food restaurant on Friday.
Twenty-seven people have been injured, with ten in a critical condition.
Three Turkish nationals are among 10 people killed in a shooting attack in Munich on Friday, Turkey's foreign minister has said.