A far-right terrorist who was caught with bomb-making equipment and neo-Nazi material has been jailed by a Scottish court for 12 years.

Peter Morgan, 35, from Edinburgh, had already begun assembling an improvised bomb from ball bearings, which an expert said could have caused catastrophic injuries, and had a cache of bomb-making manuals at his home.

The police found a collection of neo-Nazi, racist and Islamophobic literature at his flat amassed over a five-year period, along with fuses, ball bearings, nail gun cartridges, a model rocket initiator, a large quantity of fireworks and propellants.

He was photographed at one neo-Nazi rally with a poster bearing the letters NF, for National Front, and the slogan “white pride worldwide” and holding a Scottish saltire flag.

Morgan had recently been found guilty by a high court jury of two charges under the Terrorism Act and one charge under the 1883 Explosive Substances Act, dating from April 2012 to July last year.

Jailing Morgan for 12 years plus an extra three years under supervision, Lord Boyd, the judge, told him: “These charges threaten the safety of the public, our values as a democracy and strike at the dignity and respect which all members of our community are entitled to expect whatever their race or religion.”

Boyd added: “You assert your right to freedom of speech. However abhorrent some may find your views, you are entitled to hold them. What you are not entitled to do is to act on these views for the purpose of committing or preparing an act of terrorism.”

Police Scotland said Morgan’s bomb factory and files were found unexpectedly while police were investigating the death of a young woman in the stairwell of his block of flats on Taylor Place, Edinburgh, in July 2017. As part of that investigation, they forced entry into his flat and found all his material.

Facebook Twitter Pinterest A model rocket ignitor and fireworks found by police in Peter Morgan’s Edinburgh flat. Photograph: Crown Office/PA

The Crown Office, Scotland’s prosecution authority, said forensic examination of Morgan’s computer showed he had read and downloaded files on bomb-making, how to remove DNA from a dead body and the best way to dispose of a corpse.

There were computer files on types of torture, buying and transporting weapons, and guerrilla warfare and Morgan had aired his racist and Islamophobic views in online chat rooms and forums.

The court had heard there were no specific targets identified, but Boyd said: “Of most concern is that you not only possessed the ingredients for the making of an improvised explosive device but you had begun to assemble it.

“You took a vinegar bottle and fixed to the outside of it approximately 80 ball bearings and metal propellant cartridges. It is clear that your intention was to increase the lethal nature of the device.

“The bomb disposal expert described the injuries that might be sustained if one was exploded within three to five metres of a person as ‘horrific’.”

Morgan’s 12-year sentence has been backdated to last year from when he was first remanded in custody. After he is released he will be subject to an additional three years of community supervision, Boyd told him.