“After a bet at school with a student he took the gun in to show him; he accepts it was entirely inappropriate.”

A 14-year-old boy took his mother’s gun into an East Cambridgeshire school as part of a bet with friends, a court heard this week.

And two days later the teenager admitted stealing �400 from his family to buy cigarettes and cannabis - he claimed he was buying drugs from a dealer at school.

The youngster carried the pellet gun into the secondary school in his rucksack, and had been giving friends a peek at the weapon before staff got wind of what was happening.

When a student support manager asked to see the gun, the boy refused, he ran off and dumped the gun by some skips. It was later retrieved by a teacher.

Appearing at Ely Youth Court on Thursday, the teenager, who cannot be named for legal reasons, admitted possessing an imitation firearm in a public place on February 8. He also admitted stealing �400 cash on February 10.

Prosecuting, Sally Hickling said teachers became aware of the gun in school, when pupils reported being shown the weapon inside the rucksack.

The 14-year-old was taken to an office, where he explained that the gun was owned by his mother. When arrested, the teenager told police he had taken the gun into school “to show off to his mates,”

Two days later, the boy’s mother became concerned about telephone and Facebook messages he was receiving in regard to drugs, said Ms Hickling. It was later discovered that around �400 was missing from a tin that had contained �2 coins.

The teenager admitted taking the money for cigarettes, and claimed he bought cannabis from someone at school.

Mitigating, Samantha Marsh said: “He did not think about the implications of his behaviour. It was his mother’s gun, kept in a drawer in the kitchen. It did not work, there were no pellets with it.

“After a bet at school with a student he took the gun in to show him; he accepts it was entirely inappropriate.”

She said the boy had taken the cash from the collecting tin in small quantities, for cigarettes and cannabis.

The court ordered a pre-sentence report and adjourned the case to Cambridge Youth Court on April 6. He was given conditional bail.