An innocent shopped was saved from a "gangster's" bullet by an exploding Pepsi can that was hit by the gunshot.
The 66-year-old victim was hit by 30 pellets after Liam Cameron fired at a rival in Ellesmere Port town centre, and missed.
As the bullet shot past the 31-year-old target, it hit the pensioner's shopping bags and caused the tin of fizzy juice to erupt.
Chester Crown Court heard that the incident took place in an alleyway, just off Enfield Road, on November 30 last year.
Shortly before the shooting Cameron had intimidated his intended victim by cycling outside a sandwich shop after seeing him inside.
The target saw 26-year-old Cameron heading down the alleyway and he left the shop to confront him.
Meanwhile, as the confrontation took place, the innocent member of the public was walking down Enfield Road when he heard a loud bang.
He felt a sudden impact to his leg, which he described as being hit by a sledgehammer, and he fell to the floor.
His injuries were so significant that he required surgery after 30 pellets were lodged at the bottom of his leg, however only one could be safely removed.
The bullet hit the shopping bag he was carrying and caused the items to explode.
The shooting took place when a large number of people, including two children, were in the area at the time.
Officers were quickly deployed to the scene and the town was cordoned off while paramedics treated the injured man and he was taken to hospital.
Meanwhile, Cameron had immediately fled on his bike and hid from police at his girlfriend’s home in Bromborough.
He was arrested by officers the following day and subsequently charged.
On Wednesday 26 August Cameron was told he must serve seven years and six months of his term before he can be considered for parole.
He was sentenced for two counts of grievous bodily harm with intent, possessing a firearm with intent to cause fear or violence and being concerned in the supply of Class A drugs.
He will be eligible for parole after serving seven years and six months in prison.
On sentencing Cameron, Judge Everett described him as a "gangster with a gun".
Detective Inspector Nigel Parr, of Ellesmere Port Local Policing Unit, said: “Cameron intended to cause serious harm to his target but missed and injured an innocent passer-by instead.
“The injuries the victim sustained were extremely serious and he will live with the consequences of that for the rest of his life.
“It is likely that the shopping the man was carrying helped save him from greater harm as it bore the brunt of the blast before hitting his leg.
“Cameron fired his weapon, without a thought for the people in the area and left the town in fear. His actions were nothing short of reckless and dangerous.
Get all the latest crime news from your area by entering your postcode below
“Although both men will always be reminded of what happened that day, it is perhaps pure luck that no-one suffered life-threatening injuries or worse, lost their life.
“I want to thank everyone who played a part in ensuring a dangerous man has been taken off the streets and putting him behind bars for a very long time.”
David Keane, Police and Crime Commissioner for Cheshire, said: “This incident terrified the local community and my thoughts are with the man who was injured.
“I want to take this opportunity to praise all the officers involved in catching Cameron and ensuring justice was served for both men and the wider community.”