The gun used by the deranged Munich killer had been bought on the 'dark web' and was originally from Slovakia, according to investigators.

The 9mm Glock handgun was smuggled into Germany and sold illegally to 18-year-old killer Ali Sonboly.

The serial number on the weapon had been erased but police sources have revealed the firearm carried a certification mark from Slovakia.

It is believed the weapon used to kill nine people on Friday was a replica that had been converted to fire live ammunition.

The gun used by Ali Sonboly was a replica Glock, just like this one, which had been converted so it could fire live ammunition

The Glock 17 pistol was sold illegally via the the 'dark web' - sites on the internet that can only be accessed with passwords and are often used to sell drugs, child porn and other items illegally.

WHAT IS THE 'DARK WEB'?

In the mid 1990s, US military researchers created a technology that allowed intelligence operatives to exchange information completely anonymously.

They released it into the public domain and it became a 'dark web', a network of hidden websites, which allow untraceable online activity by paedophiles, terrorists and other criminals.

In 2014 Britain's then Prime Minister David Cameron said GCHQ planned to attack the dark web and root out criminal activity. He said: 'The dark net is the next side of the problem, where paedophiles and perverts are sharing images, not using the normal parts of the internet that we all use.'

But the 'dark web' is also used by people for 'legitimate' reasons - for example whistleblowers like Edward Snowden and activists during the Arab Spring, who can upload information anonymously without fear of censorship or retribution.

Sonboly spent hours locked in his bedroom playing violent computer games and using the internet.

Police seized his computer from the home he shared with his parents and younger brother.

By examining his hard disk they will be able to find out where the gun was purchased from and most likely who was involved in its handling on its route from Slovakia to Germany.

Germany has strict gun laws and Sonboly would not have been granted a licence to own a weapon.

He had been undergoing treatment for depression at the Klinikum Harlaching Hospital in Munich last year, according to the a report in the German media.

He spent two months as an inpatient at the psychiatric unit and was also being treated for attention deficit disorder.

According to a report in the Süddeutsche Zeitung newspaper police found the manifesto of mass killer Anders Brevik on his computer.

Sonboly carried out his shooting rampage on the fifth anniversary of Brevik killing 77 people in Norway.