A judge has applauded the bravery of three post office workers who tackled a would-be robber wielding a gun.

Sub-postmaster Ted Sample grabbed Sam Dunning's arm after the 21-year-old barged into the post office at Ilkley railway station at opening time on November 4 last year.

Mr Sample took the gun - which later turned out not to be loaded - and pinned him down, a Court heard. His colleagues, Yvonne Kierman and Carol Sienkiewicz, then restrained Dunning on the ground until the police arrived.

Today Dunning, of Skipton Road, Ilkley, was starting a four-year jail sentence.

He pleaded guilty at Bradford Crown Court on January 24 to possession of an imitation gun with intent to commit robbery. Sentence had been adjourned for probation reports.

Prosecutor Helen Sanderson told Leeds Crown Court yesterday that Dunning barged into the post office at 9am brandishing a BB (ball bearing) gun.

Mr Sample immediately seized his arm and they struggled. Dunning's head hit the wall and Mr Sample disarmed him and pinned him down.

His female colleagues rushed to help and Dunning was restrained until the police arrived. Officers seized the gun and a devil mask from Dunning.

Dunning's barrister, Robin Frieze, said it was a ham-fisted and unsophisticated attempt at robbery.

He said Dunning had pleaded guilty at the earliest opportunity and was of previous good character.

Mr Frieze conceded that it must have been "a terrifying experience" for the three staff members.

"It was a ball bearing gun and it was not loaded," Mr Frieze said.

He described the defendant as "an isolated, emotionally immature and vulnerable young man" and said that although it was a serious offence it was not likely to be repeated.

Dunning had been held in custody and it had been the shock of his life for him.

Judge James Stewart QC said: "I think there would be public outrage if I was to pass a suspended sentence."

He told Dunning that he had little doubt that his abuse of cannabis over many years contributed to him committing the offence.

The judge praised the "immense courage of the sub-postmaster and the two women who worked there".

He quoted Mr Sample as saying afterwards: "I'm not having this," when the defendant burst into his post office.

The judge said that the sub-postmaster did not know that the gun wasn't loaded.

He added: "Those who rob sub-post offices with imitation or any other form of gun must expect long sentences."

After Dunning had been sentenced, the judge praised Mr Sample and his staff for showing courage well beyond the call of duty and awarded all three £100 each from public funds.

Carol Sienkiewicz, one of the three staff who tackled Dunning, said she was satisfied to see him sent to prison.

Mrs Sienkiewicz, of Silsden, said: "Ideally I would like it to have been more than four years but I half expected it to have been less the way things are nowadays, so I am quite happy about it."

She said: "I was absolutely terrified - it was awful, it really was. Ted was grappling with him when I came into the office. I rang the police and Ted had him pinned down and had taken the gun off him.

"Yvonne was lying across his legs but he was still thrashing about so I sat on him as well."

Mrs Sienkiewicz had worked at the Station Road Post Office since June. She had previously worked at Silsden Post Office for eight years.