The Bavarian Criminal Police Office confirmed on Tuesday that authorities had arrested a 31-year-old man suspected of illegally selling the gun used to kill nine people last month.

The nation was stunned after 18-year-old German-Iranian Ali David S. went on a mass shooting in Munich's Olympia shopping mall on July 22. He apparently obtained the weapon, a semiautomatic Glock 17 pistol, on the black market.

The rampage ended after the gunman apparently turned his weapon on himself. An additional 36 people were injured in the shooting.

Sting operation

An investigator said he arrested the man on Tuesday during a sting operation in Marburg, north of Frankfurt. The official reported that the suspect allegedly met with the shooter twice, once in May to sell him the gun and then once four days before the shooting to sell him the ammunition.

The suspect, who sold weapons on the so-called "darknet," was armed with his own gun at the time of his arrest. He had been apparently attempting to sell a machine gun and a pistol illegally.

A motive for Ali David S.' rampage is still unclear, though the teen was apparently inspired by earlier mass shootings in Europe. One mass shooting, committed by Anders Breivik in Norway, happened five years earlier to the day before the Munich rampage.

blc/rc (AFP, dpa)