Story highlights Gunman had visited and photographed site of a 2009 mass shooting, officials say

Documents confirm the gunman suffered from mental illness, police say

(CNN) The gunman who killed nine people in a rampage in Munich on Friday was obsessed with mass shootings and appeared to have planned the attack for a year, officials said.

"He appears to have planned this act since last summer," Robert Heimberger, president of the Bavarian state criminal police office, said at a press conference Sunday.

"He completely occupied himself with this act of rampage."

JUST WATCHED Germany mourns the nine victims Replay More Videos ... MUST WATCH Germany mourns the nine victims 01:49

Police have not named the attacker. They said he was an 18-year-old with dual German and Iranian nationality who was born and raised in Munich. Neighbors told CNN Saturday that a teen named Ali Sonboly lived in an apartment searched by police, the same name reported by German media outlets.

On Sunday, a 16-year-old Afghan believed to have been a friend of the attacker was arrested on "suspicion of being an accessory," Munich police said.

Read More