Former Royal Marine had home-made pipe bomb at flat
Allan Peach stored the device in a safe at a property in Dundee.
A former Royal Marine Commando caught with a pipe bomb in his flat and equipment to make nine more devices has been jailed for six years.
On Thursday, the High Court in Glasgow heard that 30-year-old Allan Peach stored the improvised explosive device (IED) in a safe at his home in Carlochie Place, Dundee.
Army bomb disposal experts had to be called in after his block of flats were evacuated on September 6 last year.
Nineteen cans of CS gas were also discovered, which Peach planned to sell for up to £90 each.
Judge Lord Clark told Peach: "There has been no suggestion of involvement in terrorism, but your intent was to endanger life and property.
"These offences must attract a custodial sentence to deter you and others from such dangerous activities."
In order to protect the public, Lord Clark ordered Peach to be monitored in the community for three years.
'I'm not a bad man. I'm just trying to make ends meet'Allan Peach
Referring to the CS gas canisters, Peach told police: "I'm not a bad man. I'm just trying to make ends meet."
Peach pleaded guilty to possessing an improvised explosive device and materials with intent to endanger life or cause serious injury. He admitted a further charge of having a quantity of CS spray.
The court heard he was previously jailed for three years in 2012 after causing a blast when he stuffed a hair gel tub with explosives at a tenement in Dundee.
During the raid in September last year, police initially discovered a box containing cans of CS gas and Peach then handed over a set of keys for a safe where he kept the pipe bomb.
Prosecutor Bill McVicar said: "On opening it, police observed what appeared to be an improvised explosive device.
"It had been manufactured from a copper pipe with end caps attached and a fuse at one end."
Nearby homes were evacuated and a 100 metre exclusion zone set up amid fears of potential danger.
The device was made safe before being analysed by experts.
The substance inside was found to be a mixture of powders indicating the pipe bomb was a "poorly made low explosive".
The court heard Peach, an electrician, had latterly been studying agricultural architecture at college in Dundee.
'He bought the materials for the pipe bomb over the internet for use by himself. He planned to take it to a field and detonate it'Solicitor advocate Chris Fyffe
Solicitor advocate Chris Fyffe said: "He is somewhat vulnerable and emotional individual.
"He bought the materials for the pipe bomb over the internet for use by himself. He planned to take it to a field and detonate it.
"Experts who tested the explosives initially couldn't get the powder to light but managed to do so under laboratory conditions.
"He planned to sell the canisters to gain financial independence."