A man has died after being accidentally shot by his own passenger as he attempted to fire out of a car window, police say.

Matthew Gibson, 26, was pronounced dead on 22 July after being shot in the head during the incident which prosecutors portrayed as a drive-by shooting gone bad in Park Manor, Chicago.

Related Video: 15-year-old Girl Shot 7 Times in New Jersey Drive-By Shooting

Video footage from 21 July showed Gibson pulling alongside a white SUV that was waiting to make a left turn at around 5:40am, according to reports from the Chicago Sun-Times.

As the car slowed his passenger, Jake Lee, opened fire on the vehicle with a .40-caliber handgun.

However Lee, 27, accidentally shot his driver in the head during the incident. Despite his injuries Gibson was able to drive two miles from the scene.

A 22-year-old man was also wounded during the shooting. Prosecutors for Cook County added that there did not appear to be any sign of shots being fired from the white SUV.

Gibson was found to be brain dead on Monday, and was kept alive only to have his organs harvested. His death was ruled as a homicide.

His death was the 271st recorded homicide in Chicago this year, a figure that has risen to 277 since the incident. Of those deaths, 243 were killed in shootings.

Lee, from the cityâ€™s Englewood area, now faces a charge of aggravated battery with a firearm, and is expected to face a count of murder.

He was placed on parole in April 2017 after having served an eight-year sentence for aggravated battery with a handgun, a period that was set to end in 2020.

Lee was denied bail at a hearing on 23 July.