Police had began tracking the 31-year-old German suspect while investigating two cases of illegal arms transactions that were unrelated to the Munich gunman, David Ali Sonboly.
After establishing the suspect's transaction procedure through the internet and encrypted emails, investigators set up a fake deal for the purchase of a machine gun, pistol and ammunition.
During the process, the unnamed "suspected weapons dealer" said that he had supplied the Glock 17 pistol and ammunition to the Munich assault gunman", prosecutors said in a statement.
Sonboly killed himself after his murderous spree on July 22 with the pistol he had bought on the internet.
His attack, which began at a McDonald's branch, also left 35 people injured.