Police said the off-duty officer was walking with two other men, ages 43 and 45, in the 4600-block of North Kedzie Avenue just before 7:25 p.m. when a when a confrontation started between them and the people inside a passing dark-colored sedan.
Surveillance video shows the vehicle pulled into a McDonald's parking lot, drove around the drive-thru and returned to engage with the group, police said. Fernando Brieto-Solano, 22, allegedly brandished a weapon in the direction of the group and fired shots from inside the vehicle.
Police said that's when the off-duty sergeant in the group discharged his weapon. The suspect was shot in the head. He drove himself to Swedish Covenant Hospital to seek treatment for his injury, which police said was not life-threatening.
Brieto-Solano, of the 2700-block of North Major Avenue, was charged with attempted first-degree murder.
Police said Juan Ramirez, 26, was also inside the vehicle at the time of the shooting. He is accused of hiding the gun used in the shooting on the hospital grounds, which officers later recovered.
Ramirez, who lives on the same block as Brieto-Solano, was charged with attempted first-degree murder and unlawful use of a weapon by a felon.
Brieto-Solano and Ramirez are both due in bond court Tuesday.
The off-duty sergeant was not injured and neither were his friends. He works in the 19th District and was placed on 30-day administrative leave.
The Independent Police Review Authority is investigating. The incident is the fourth police-involved shooting in Chicago so far in 2017.
The Sun-Times Media Wire contributed to this report.