Dannie Robinson, formerly of Lilac Road, Hucknall, was sentenced at Nottingham Crown Court on Wednesday after he pleaded guilty to affray and possession of a firearm with intent to cause fear of violence.
Nottinghamshire Police were called to Kirkby Road at around 7pm on 25 January 2020 following a report that occupants of a Volkswagen Golf had got out of their vehicle after stopping in stationary traffic and attacked another car with hammers and bats before it was driven off.
The occupants then got back into the Golf and drove away. It was later located in Hucknall and stopped by armed officers on Bestwood Road.
Robinson, the driver, was arrested along with rear passenger Gareth Martin, 32, and a third occupant in connection with the affray incident and for possession of offensive weapons which were found inside the car.
While officers were dealing with the incident a member of the public told police they had found a gun on a nearby pavement.
It was later found to contain two live bullets and officers subsequently arrested the three suspects on suspicion of possession of a firearm.
Forensic tests on the gun resulted in DNA matches for Robinson.
Martin, of Larch Gardens, Nottingham, was also convicted on Wednesday.
He was handed a 12-month sentence, suspended for 18 months, after pleading guilty to affray.
Martin was also ordered to carry out 120 hours’ unpaid work and to complete 25 rehabilitation activity requirement days.