According to a report in German newspaper Sueddeutsche Zeitung, police believe Sonboly bought the gun on the "dark web" — a highly secure part of the Internet, only accessible with special types of software, and known to be used by criminals in the smuggling of weapons and other illegal items.
It's thought the gun was sold as a deactivated weapon but then reactivated before the attack, with reports suggesting the gun had been registered in Slovakia in 2014.
Fears Over Schengen Gun Smuggling
While Germany has strict gun controls, the apparent ease at which weapons can be smuggled into and within the EU's passport free Schengen travel zone has led officials in Berlin to call for a common EU policy.
"Our guns laws are already very strict, and I think that is correct," German Interior Minister Thomas de Maiziere told the Bild am Sonntag newspaper.
De Maiziere says that EU is in the process of producing tighter gun possession laws, but this is not the time to discuss legal ramifications— Kate Connolly (@connollyberlin) July 23, 2016
"In Europe, we want to make further progress with a common weapons policy. First we need to determine how the perpetrators procured a weapon, then we have to look very carefully at where to make legal changes."
However, Berlin's calls for a common weapons policy may run into difficulties, with firearms guidelines varying significantly from country to country.
For example, there have been concerns about Belgium being a hotbed for illegal weapons, with the guns used in last November's Paris attacks thought to have come from the country's black market.
The #Paris attacks also involved suicide bombers and automatic weapons in a country where these weapons are not found legally— Michael Horowitz (@michaelh992) June 13, 2016
Germany's strict gun ownership laws are also at odds with other countries such as the Czech republic, which is far more lenient on the issue.
Questions have also been posed at the effectiveness of Berlin's gun ownership measures. Germany has the highest gun ownership in the EU — with firearms deaths double the number of those in the UK.
Let me correct w/quick research, @JoshEisenhower8—German gun ownership is actually relatively high, but the process for getting one is tough— Peter Stanton (@peterstanton) June 23, 2016
Attention is also set to turn to the dark web, if it is proven to be the source of the weapons used in Friday's rampage, with law enforcement authorities concerned about its use in facilitating the sale of guns, ammunition, child pornography content and other illegal items.
Any attempt to police the dark web may be difficult however, as various software programs aimed at avoiding detection and tracking are being utilized by dark web users.