The killing spree in Munich last month by an 18-year-old student caused shockwaves in Germany. There is now a breakthrough in the case with the arrest of the man who allegedly supplied the gun used to take the lives of nine people. The unfolding saga has provided disturbing insight into how the underground web – the dark net – was used to plan the murders and how it can be used to carry out future attacks.

It was a stroke of luck that led detectives to a 31-year-old unemployed salesman in the town of Marburg who had allegedly procured the Glock 17 pistol for Ali David Sonboly, the young German-Iranian gunman. They had been looking at two different attempts to use the dark net to obtain weapons, one by a 62-year-old accountant, the other a 17-year-schoolboy – illicit transactions which in themselves illustrate the growing reach of the supposedly secret internet forum.

A “sting” operation was set up and it was while this was under way that the gun seller allegedly incriminated himself over the Munich massacre. He is said to have told undercover officers about handing over the Glock and 350 rounds of ammunition to Sonboly in two meetings: one on 20 May, the other on 18 July, four days before the shooting.

The deaths resulting from that purchase was one of five acts of killing in Europe over 12 days, claimed by Isis. These have heightened fears of jihadist terror and added to recriminations over the West’s apparent inability to deal with the threat, as well as the supposed security threat posed by the waves of Muslim refugees coming to the Continent.

Despite claims and counter-claims, no Islamist terrorist motive has emerged for Sonboly’s attack. He had written what has been described as a “manifesto of murder” after studying the actions of Anders Breivik, the Norwegian neo-nazi who killed 77 people five years ago. Sonboly had suffered psychological problems and had been regularly bullied in school, factors which the authorities say may have triggered his rampage.

It can be revealed that last December, seven months before he carried out the murders, Sonboly, using the name Mauracher, had placed a seven-line message requesting a Glock 17 pistol and 250 rounds of ammunition, for which he offered €2,500. He eventually ended up paying almost €2,000 more for them.

Allied Western security agencies have been kept informed by the Germans about the inquiry which followed, the information augmenting concern about the use of illicit internet sites by terrorists and violent criminals. Following the suicide bombings in Brussels last March, the French interior minister, Bernard Cazeneuve had called for greater control of sites “which are not indexed by traditional search engines and which run a large amount of data issued by criminal organisations including jihadists… Those who attack us use the dark net and encrypted messaging to get access to weapons to hit us”.

Sonboly used the encryption system PGP, making his purchase with Bitcoins. There is a strong possibility that he bought a second weapon which has not been found. Police are looking at claims that he was seen with another gun and his internet searches had also included requests for .45 calibre ammunition, not needed for a 9mm Glock.

The dark net is used for a range of highly-illegal purchases including drugs, child pornography and arms. Those using it need to be adept at navigating its complex avenues while ensuring anonymity. Sonboly was not considered to have technical expertise and German police say they do not know how he acquired the necessary skills. Neither can they explain how the teenager, whose sole income was a paper round, was able to get €4,350 for the pistol and ammunition. There are indications that he bought the Bitcoins last year when the price for the crypto-currency was much lower, showing further pre-planning and a degree of financial acumen.

Asked in the days following the Munich killings how Sonboly was able to use the underground market, Robert Heimberger, the head of the Bavaria forces criminal investigations branch responded: “I don’t know, I can’t get on the dark net myself, but I am noticing that many teenagers are actually able to get on it.”

Robert Emerson, a British security analyst, said: “If teenagers can get on it, then so can many others involved in terrorism and organised crime. When guns are supplied to terrorists and robbers, there is always a chance that it can be traced, networks dismantled. But there are serious obstacles if the deal is done through the dark net because the raison d’etre for that market is secrecy. It is also an international market and goods can be shipped anywhere, this is why we are likely to see increasing use of it by terrorists and criminals.”

Germany eyes tighter gun control after Munich attack

The Glock 17 Sonboly used had a certification mark from Slovakia. It had, at one stage, been decommissioned and used as a theatre prop. It was then reactivated before being sold to him. The Kalashnikov AK-47s used in the Charlie Hebdo murders in Paris in January last year were also decommissioned and then converted back to fire live ammunition. The purchase however was not through the dark net and the supply chain was traced back to a shop, once again in Slovakia, in the west of the country.

Despite the difficulties posed by the underground web market, British and German security agencies had successfully carried out a joint operation to uncover firearms trafficking involving the dark net. Two years ago Alexander Mullings, a career criminal, used a mobile phone from his cell in Wandsworth prison to order Skorpion sub-machine guns from Germany. The supplier, who had been active in the underground internet market, turned out to be a student at the Bavarian city of Schweinfurt.

The German government maintains it has tight gun control laws. However, in the aftermath of the shooting, interior minister Thomas de Maizière stated that further regulations may be brought in and that “in Europe, we want to make further progress with a common weapons policy.” “First we have to determine how the Munich perpetrator procured a weapon, then we have to look very carefully at where to make legal changes,” he said.