A postmaster who suffered concussion as he tried to foil a robbery at gunpoint has been commended for his bravery.
David Taylor was hit twice over the head with a metal bar as he tried to deter the raiders at Cefn Mawr sub post office near Wrexham.
Nathan White, Carl Davies and Jimmy Pritchard were jailed for their part in the robbery at Mold Crown Court.
Judge Peter Heywood said Mr Taylor had shown "remarkable courage".
During the robbery on 15 July, White and Davies wore ski masks and gloves and armed themselves with a handgun, a meat cleaver and a metal bar, before stealing £54,000.
White, 26, and Davies, 28, both of Wrexham, admitted robbery, possessing a firearm and burglary at an earlier hearing.
Pritchard admitted the robbery on the basis that he checked the premises out for the others but took no part in it directly.
The court heard Mr Taylor's wife, Janine, had been held down on the floor by the neck at gunpoint as her husband attempted to grab the keys of the raiders' getaway car.
Even when he was bleeding profusely from the head after being hit with the bar, Mr Taylor again grappled with his attackers and tried to grab the keys, the judge was told.
He was then forced back after being threatened with a meat cleaver.
The judge said that Mr Taylor and his wife Janine had been through a "terrifying ordeal".
Sentencing the men, he said that it was a serious and well planned robbery.
"Post Offices and small shops are always vulnerable. They are easy targets. You had looked very carefully at the suitability of these premises to attack," he told them.
"It cannot be said with any certainty if the gun was real or an imitation but I suspect it made little difference as far as Mrs Taylor was concerned. She was terrified."
Mr Taylor had shown remarkable courage by three times striking the robber who was armed with the metal bar, the judge said.
He jailed White and Davies for seven years each and Pritchard for five years.
All three defendants said that they were ashamed and remorseful for what they had done.
White and Davies had previous convictions for robbery.
Judge Heywood also praised two police officers, Det Sgt Eleri Deverall and Det Con Roslyn Morgan, for their "thorough and effective" investigation.
Specialist financial investigators will now attempt to reclaim the stolen money via a Proceeds of Crime investigation.
The court was told that about £40,000 was still unaccounted for.