A man who systematically targeted police officers, a solicitor and a judge as he became consumed with revenge has been jailed for 20 years.
Ashkan Ebrahimi, 33, conducted extensive research on 38 different individuals, as he amassed chemicals and a terrifying arsenal of weapons, including swords, crossbows and air rifles.
Senior officers said they strongly believe that he would have eventually executed his plans in harming a police officer on the streets of West Yorkshire.
Ebrahimi, of Oak Lane, Halifax, was sentenced on Tuesday after being found guilty of possessing explosives with intent to endanger life, possession on an offensive weapon, possession of a bladed article in a public place and stalking offences.
A jury at Bradford Crown Court heard how Ebrahimi became obsessed with revenge against the authorities after he was issued with a non-molestation order against his ex by a judge in the county court, and was later separated from his young child.
A police spokesman said: The effects of this action sowed the seeds of a deep hatred of the police that grew exponentially from that moment.
He believed that the police were committed to destroying his life and set about seeking to take extreme violent action against them.
Ebrahimi was arrested in October 2015 after concerns were raised by Calderdale College about his unusual interest in chemicals and wanting to develop a science lab at home.
His home was raided and officers found a book detailing 21 vehicle registration plates of cars belonging to people he was interested in and photographs of their addresses.
His satnav revealed he had visited the home of a police chief inspector, and the judge who gave him a non-molestation order.
The home addresses of other police officers and his exs solicitor were also found at his home.
Police also found he had researched the use and effects of chemicals, how police officers are protected when not at work and sophisticated surveillance equipment.
A large amount of chemicals were also recovered from Ebrahimis address, along with an extensive collection of weapons including knives, swords, crossbows and high-powered air rifles.
Ebrahimi had 90 videos saved relating to the creation of explosives, fuses, detonators and gunpowder.
Detective Chief Inspector Warren Stevenson said: Ebrahimi is a very dangerous individual who posed a significant and very serious threat to police officers, police staff, solicitors and the judiciary.
He developed a deep-seated and consuming hatred and loathing for people in authority, in the main police officers, and set about research and planning his limitless revenge against them.
Mr Stevenson said: The volume of weapons, substances and associated material recovered from his property were to enable him to commit the most serious harm to others and I strongly believe that he would have eventually executed his plans in harming a police officer on the streets of West Yorkshire.