Stunned police officers discovered a laboratory for making bombs and producing the drug crystal meth when they searched a criminal's bedsit, a court heard.
Bomb disposal teams had to evacuate the flats in Wakefield and counter terrorism officers were also deployed after the flat was found full of explosive powders and liquids for producing home made bombs.
A court heard Vladimir Madle, a 42-year-old Czech national, had also turned the flat into lab for producing methylamphetamine, also known as crystal meth.
Madle was given a 13 year prison sentence after being found guilty of a string of drugs offences and offences under the Explosive Substances Act.
A judge told Madle he considered him to pose a serious danger to the public because of his "expertise and fascination" with making improvised explosive devices (IEDs).
Leeds Crown Court heard the offending came to light on June 25 last year when Madle was carrying out unpaid work as a part of a community order he had been given for possessing an offensive weapon.
Madle was sent to St Mary's Church in Tingley to carry out the unpaid work and was spotted smoking crystal meth during his lunch break.
Police were called and found him in possession of over £3,000 worth of the drug, a flick knife and explosive powders.
Packages were also found in his rucksack which had to be destroyed by an army bomb squad.
Officers were sent to search Madle's flat at Westgate End, close to Wakefield city centre.
Jonathan Sandiford, prosecuting, told jurors: "The bedsit smelt strongly of chemicals that resembled bleach and nail varnish and there were lots of different size bottle and containers of unknown liquids and some liquids being funneled into small glass jars on the floor by the kitchen area and also on the kitchen worktop."
Next to the fridge was a black package about the size of a two litre bottle completely wrapped with black electrical tape and with what appeared to be a fuse going through the middle of it and matchsticks stuck to the top.
The package was later found to have been packed with 77 fragments of glass and contained an explosive made up of potassium permanganate, potassium nitrate, sulphur and aluminium powder.
Improvised pyrotechnic fuses were also in the property made from lengths of string and coated with explosives.
Explosive powders and bomb components were found in Tupperware boxes, coffee jars, aerosol caps, soup containers and drinks bottles.
Mr Sandiford said: "(The officers) believed, correctly as it turned out, that the bedsit possibly contained a bomb and bomb making material."
Chemical Biological Radiological and Nuclear (CBRN) teams were also called to the property.
The other occupants of the flats had to be evacuated along with everyone within a 100 metre radius.
Mr Sandiford said a large amount of chemicals and powders were found in the flat consistent with the operation of a drugs laboratory.
Evidence was found that Madle was producing crystal meth from Sudafed tablets.
The prosecutor said: "The Crown say that the defendant clearly had an interest in chemicals and explosives and so had manufactured his own explosive and made an IED packed with glass for the purpose of protecting his trade either by way of direct defence should he be attacked or by intimidation of anyone who might be minded to interfere in his affairs.
"Either way required an intention on his part to use the IED to endanger life or cause serious damage to the property."
Madle was found guilty of possession of an explosive substance with intent to endanger life, five offences of possession of an explosive substance, producing a class A drug, possession of a class A drug and possession of an offensive weapon.
Madle claimed at trial that he had bought the explosive substances and made the bomb to throw in a lake to catch fish.
The court heard Madle was sentenced to ten years in his home country in 2001 for a drug offence after a man died when he injected him with heroin.
He also has previous convictions for violence.
Madle must serve a custodial term of 11 years followed by an extended period on licence of two years.
The court heard Madle's offending was not linked to terrorism or any political affiliation.
Sentencing Madle, judge Mushtaq Khokhar said: "Given your fascination and a certain amount of knowledge and expertise for you to be able to assemble such devices, it gives me cause for concern that there is a significant risk that you would commit offences of this nature where the device...would be exploded, causing serious harm.