A 15-year-old “model pupil” held up a branch of Barclays with an imitation firearm and stole more than £2,000 before confessing the entire crime to his mother, a court heard.

Liverpool Youth Court heard how the teenager, who cannot be named for legal reasons, re-enacted a “real-life video game” in an elaborate plan which involved holding two bank cashiers and a customer at gunpoint.

But it was foiled two days later by his mother who found cash, stained with dye, and a fake firearm in his bedroom. Today the boy’s mother wept at the back of the court as her son was brought into the dock where he pleaded guilty. The court heard that the boy was a “top set” pupil at school.

Download the new Independent Premium app Sharing the full story, not just the headlines

The raid took place at the Barclays branch in Breck Road, Liverpool last Friday. Debra Chan, prosecuting, told the court the teenager was seen walking into the bank at 11.45am wearing a black Parka-style coat, with the hood up and a scarf covering his face.

The boy, armed with a black BB handgun, or air gun, went up to one of the cashiers and said: “I’m not messing around”, before handing over a bag. He said: “Fill that up with money”, adding: “Don’t do anything stupid. I’ve just got out of prison after five years.”

The cashiers filled the bag with a “dummy bundle” which is designed to detonate and spray dye over the cash when it leaves the building, Miss Chan said. The court heard the boy’s mother found the cash and later a gun in a yellow bag while she was tidying his bedroom on Sunday.

She then gathered her family together and placed the items on the coffee table in the living room and asked her son where they had come from.

The boy immediately admitted what he had done and the family took him to the police. The court heard that he told officers: “I robbed it with a BB gun.”

After his arrest the teenager said he carried out the robbery because he was envious of other people’s material possessions, the court heard.

Sending the case to Liverpool Crown Court for sentence, District Judge Ian Lomax said: “It’s a bizarre, surreal case of a young man almost acting like a real-life action video game.”

Miss Chan said the two bank staff were traumatised by their ordeal but were not hurt and, during his police interview, the boy apologised for what he had done. He will be sentenced on 15 October.