A man who sent a letter threatening to petrol bomb Edinburgh Sheriff Court and shoot a sheriff signed it with his full name.

The letter from 24-year old Michael Grady arrived at the court in Chambers Street on January 20 last year and he was arrested the following month.

Grady, a prisoner at HMP Addiewell, pled guilty in March this year to behaving in a threatening or abusive manner by sending the letter and was sentenced at the same court on Thursday.

Fiscal depute Kim Schofield had told sheriff Norman McFadyen that a court official opened Grady's letter.

The letter read: "Hi Ya, this letter is for the judge or P.F. I am writing this letter to say if I am found guilty, as soon as I get out, I will petrol boom (sic) the court and will be putting bullets through use (sic).

"If not me, then someone else, but trust me it will happen. So, if you know what's good for you, watch your back and I am brave enough to give you my name, Michael Grady. You are f.....g me. Use (sic) will dee (sic).

"F**k The Crown and Polis (sic)."

Defence solicitor, Kenneth Cloggie, told Mr McFadyen that his client was presently serving a 20-month sentence.

His offending related to substance misuse and was completely devoid of violence. Grady, he said, had been acting idiotically.

Mr Cloggie said: "His action was puerile. He gave his name."

Sheriff McFadyen told Grady the court took a most serious view of any threats to harm anyone.

The sheriff sentenced him to 24 months, running consecutively to his current punishment.

He will also be subject to a year-long supervised release order.