Drivers feared for their lives as a gunman walked down the middle of a busy road in West Yorkshire pointing a fake firearm at them.
Gary Dews was locked up for two and a half years over the terror he caused on Halifax Road, Dewsbury.
Armed police called to Leeds tower block after 'man with handgun' seen entering flats
A court heard a mum who was in a vehicle with her three-year-old child feared they would be carjacked and shot.
Dews, 49, was armed with a ball bearing gun which looked like a genuine firearm.
Bullets just missed man in drive-by shooting in Leeds street
The incident happened around 7am on April 27 this year.
Michael Smith, prosecuting, said Dews was in the middle of the road waving his arms while holding the weapon.
Gunman shot at ex-girlfriend during school run
Some motorists drove around Dews but others stopped or slowed down.
One man who stopped had the weapon pointed at his head and feared he would be shot.
A woman stopped as she thought Dews was warning her about a hazard in the road.
She drove off when she saw the gun in his hand.
Mr Smith said another man who stopped was a soldier in the Territorial Army and he believed the weapon to be genuine.
Dews was also seen throwing empty beer cans and stones at passing vehicles.
Police were contacted and Dews was arrested at his home in Batley. Officers recovered a ball bearing gun and a box for the weapon.
Dews denied having the gun in public. He said he had only used it in his garden to shoot rats.
He claimed he had almost been run over by a taxi on Halifax Road and that was why he had been waving his arms.
Dews, of Carr Top Close, Batley, pleaded guilty to possession of an imitation firearm with intent to cause fear of violence. He has previous convictions for firearms and public order offences.
Chloe Hudson, mitigating, said Dews had a number of mental health issues at the time of the incident but accepted that it must have been frightening for the victims.
Ms Hudson said Dews pleaded guilty to the offence at an early stage.
Jailing Dews, Judge Geoffrey Marson, QC, said: "It must have been terrifying.
"Men and women, sat in their cars, fearing for their lives, not knowing what was going to happen in the next second or two."