An elderly woman has been jailed for three-and-a-half years for sending a death threat to Theresa May.
Isabella Jackson, 72, sent a threat by email in 2014 when Mrs May was Home Secretary and also made bomb threats to Harrods and King's Cross Station in London and Edinburgh Airport, the Judiciary of Scotland said.
Kirkcaldy Sheriff Court heard she had already spent a year in jail for breaching her probation after making a number of hoax bomb calls in 2011.
Jackson pled guilty to four offences and was sentenced to 45 months by Sheriff Grant McCulloch on Thursday.
He said: "Notwithstanding your age and infirmity, the public requires protection from you and the discouragement of others who might consider the same path.
"Only a custodial sentence is apt for these offending.
"You did plead guilty, thus avoiding a trial. Thus what would have been a five-year cumulo sentence is restricted to 45 months, backdated to May 2."
In 2015, the 72-year-old from Buckhaven in Fife was placed on bail for the threat to Mrs May and for falsely telling Fife Council that a resident in her home had died, Mr McCulloch said.
Conditions were put on her use of the internet but Jackson still made hoax threats to London and Edinburgh earlier this year.
The sheriff said he found it "hard to accept" that Jackson had acted out of loneliness to get attention, instead describing it as "the deliberate act of a twisted mind".
He told the court: "Of course, these threats had to be taken seriously, resulting in police searches and considerable work to see how viable the threat might be.
"Finally, perhaps annoyed by the police removing your internet router, you sent a card to Levenmouth Police Office, containing powder, and the word 'death'.
"That resulted in several police personnel, and the postman, being subjected to medical quarantine and isolation, not to mention fear and alarm, for many hours.
"Your actions have deprived the public of police and security service availability, with the potential of allowing real terrorists to go about their evil business.
"You claim that this is done out of loneliness, to gain attention. I find that hard to accept.
"To me it is the deliberate act of a twisted mind, quite content to cause the utmost disruption of normal society, from the comfort of your own sofa.
"You used specialist software to hide your IP identity, showing a degree of sophistication and deceit."
Detective Chief Inspector Kenny Armstrong, of Police Scotland's organised crime and counter terrorism unit, said the threats had taken resources away from genuine incidents.
"I am at a loss as to why an elderly woman should choose to carry out this campaign of threats and malice," he said.
"The time, effort, cost and resources that have been put into dealing with each threat she made has been sizeable and took officers and emergency services partners away from dealing with genuine incidents.
"They all happened alongside a backdrop of heightened security, with the UK threat level for international terrorism at the time at severe.
"Each threat was treated seriously with the emails sent to the now Prime Minister a matter of national security.
"Even when her laptop and phone were seized, she went on to disrupt policing by sending a suspicious package to her local station and still managed to email bomb threats.
"She has shown no remorse nor given any sort of explanation for her actions, but I am pleased that she has accepted responsibility, resulting in her conviction."