Taxi driver John King, who fought off a man holding a gun to his head during a raid at a Marlborough taxi office, has been commended by a court for his courage.

At Salisbury Crown Court on Friday, Kevin Clarke, 19, of William Street, Swindon, was sentenced to four years and nine months in a young offenders' institution after pleading guilty to charges of attempted robbery, possessing an imitation firearm with intent to commit an offence, trying to pervert the course of justice and criminal damage.

The raid happened in August at the Merlin Cars taxi office in Purlyn Acre. Grandfather Mr King, 58, said afterwards: "I don't know about being brave. It was anger more than anything else."

This week, after hearing the sentence, he said: "I am pleased he has been put away before he can hurt anyone. I just hope he learns his lesson that you cannot go around doing this kind of thing.

"I still think about what happened, but you have to get on with things."

Judge David MacLaren Webster, who commended Mr King for foiling the attempt, told Clarke: "Society needs to be protected from you."

The court was told Mr King and taxi office worker Margaret Smith had found it a frightening and very traumatic experience. Neither knew the realistic-looking handgun was a fake.

Prosecuting counsel John Upton said Clarke had thrust the weapon a couple of inches from Mr King's right eye and demanded money and said: "I am serious."

Mr King said: "So is the policeman coming down the path."

As Clarke turned, Mr King grabbed his wrist and broke the grip on the gun. Clarke then ran off.

Marcus Davey, defending, said the attempted robbery was bungling and inept, caused partly by bravado to show off to friends, but Clarke had expressed sorrow and remorse.

It was also done to get money to feed his heroin habit and serious drug debts.