A man who fired an imitation gun in his back garden at half past two in the afternoon has been given a suspended sentence.

Matthew Kendell, 21, had bought the blank-firing pistol from Amazon for his own protection.

It was originally orange in colour, but had been painted black to make it look more realistic, St Albans crown court heard.

Prosecutor Robert Harding said the gun was loaded with blank cartridges and the barrel was blocked.

When a neighbour heard it being fired on 17 July 2015 the police were called and Kendell was arrested. The gun was found among a pile of clothing in his home.

Kendell, of Old Oak, St Albans, appeared for sentence having been convicted of possessing an imitation firearm with intent to cause fear of violence by a majority of 10 to 2. At the time of the offence he had no previous convictions, but in November was convicted of harassing a woman. He received 12 weeks’ detention suspended for 12 months and was made the subject of a Restraining Order.

Andel Singh, defending, said: “Whilst in his garden the firearm was discharged. There is no evidence of any particular individual complaining about a gun being pointed at them. It was purchased from Amazon - a legitimate source.”

He gave the judge four character references and described Kendell as “immature and a needy individual who needs assistance.” He said he had mental health difficulties.

Mr Singh said Kendall, who receives Employment Support Allowance, was supported by his family.

Judge Stephen Warner passed a six months jail sentence suspended for 21 months with conditions that he attends 30 days of a rehabilitation activity requirement. He must also pay £250 costs within 6 months.

The judge told him: “You fired the gun at a time of day when other people were around. Anyone witnessing what you had done would not have known it was not real. You acquired it in the misguided belief that you needed it for protection.”

He told him he was giving him a chance by not sending him to prison but warned him: “If you get in trouble again within the next 21 months you face prospect of the sentence being activated.”

The judge ordered that the gun be forfeited and destroyed.