Munich is paying tribute to the victims of the July 22 shooting in which nine people were killed with a church service attended by German Chancellor Angela Merkel and President Joachim Gauck.

The nondenominational service at the Frauenkirche, or Church of Our Lady, was the first of two memorial events on Sunday. Gauck was speaking later at an event in Bavaria's state parliament.

An 18-year-old German-Iranian man killed nine people and wounded over 30 others at a McDonald's restaurant and shopping mall in the city. He then killed himself.

Officials have said the gunman was a withdrawn loner obsessed with playing "killer" video games who had been treated for depression and psychiatric problems.

The rampage came between two other attacks in Germany claimed by the Islamic State group.