A Muslim convert from Swansea has been jailed for five years and four months for having a stash of bomb-making manuals and instructions on how to carry out "lone wolf" knife attacks.
Lee Griffiths was branded a "dangerous man" after he was caught hoarding terrorist material, including copies of Islamic State magazine Rumiyah and the Anarchist Cookbook.
The 26-year-old also had graphic videos showing prisoners being stabbed to death or blown up with a home-made explosive device.
Griffiths, from Western Road, Clydach, admitted five counts of possessing information which may be useful to someone who commits or prepares acts of terrorism and one of dissemination of a terrorist publications.
The Old Bailey heard Griffiths had been handed a hospital order in 2011 after he launched a knife attack on his mother while she slept and had twice been stopped by police for carrying blades in public.
Following his discharge in August last year and while living at a residential home for mental health service users, Griffiths was quickly radicalised, the court heard.
The extremist material was uncovered after police raided his bedroom and seized his mobile phone in January this year.
"I am not of course sentencing this defendant for preparation of terrorist acts himself at the time of his arrest. That would have been a different charge", said Mr Justice Saunders.
Mr Justice Saunders made a recommendation that on Griffiths' release, conditions of residence be attached to keep a "close eye" on his activities and, if possible, to monitor his access to the internet.
The defendant, who worked at a local food bank, was described as vulnerable and easily led but computer savvy.
Ian Ibrahim, for Griffiths, said it was difficult to mitigate in the wake of recent atrocities but stressed the defendant was a "young man with a history of psychiatric illness".
The barrister said his client never intended to carry out any acts of terrorism and was not a member of a banned group.