A teenager was caught red-handed with a rifle stolen in a raid on a gun club after his mate took photos of them messing about with it.

The 17-year-old, from the Keighley area, was sentenced to a six-month detention and training order for being in possession of the .22 shotgun burgled from Keighley Rifle & Pistol Club.

It was one of a haul of six rifles and nine air weapons seized by raiders who smashed their way into the club with sledgehammers in July, Bradford Crown Court heard. The youth, who cannot be named for legal reasons, was originally charged with dishonestly handling the gun but the Crown accepted he did not know it was stolen.

He arrived in custody at court because he is already serving a 12-month sentence for commercial burglary.

Prosecutor Paul Nicholson said the teenager’s 18-year-old co-accused had been sentenced to a community order by Bradford and Keighley magistrates for possession of the rifle.

The 17-year-old was arrested after police seized his friend’s phone and found photos on it of the two of them engaged in tomfoolery with the rifle in what appeared to be a disused factory.

The Recorder of Bradford, Judge Roger Thomas QC, said the youth was trying to look big, posing for pictures with the gun.

He warned him that if he continued to offend he would be dealt with as an adult next time and his sentences would only get longer.

Bosses at the gun club, based in Parkwood, were shocked by the determined raid.

The gang used hammers to break through an outside concrete wall and then forced open locked and wall-mounted cabinets to reach the weapons.

They also ransacked the building, causing extensive damage, but no live ammunition or rifle magazines were taken.

A club spokesman said at the time: “This year is the club’s 80th anniversary and I’ve never experienced any incident like this before. It’s heartbreaking.”

He said every possible measure had been taken in strict accordance with firearms regulations but there would be a review of security following the incident.