Police said the incident happened in the Belmont Cragin neighborhood's 5300-block of West Belmont Avenue around 11:30 p.m.
A 72-year-old man was parking his vehicle when someone tried to take property from him through the window, police said.
The victim opened his vehicle's door, and a struggle ensued, police said.
Police said the robber's gun fell to the ground and discharged, striking the victim in the leg.
The victim took himself to Community First Hospital, where he is listed in good condition.
The suspect fled the scene.
There is no one in custody, and Area Five detectives are investigating.
Police did not immediately provide further information.
INTERACTIVE SAFETY TRACKER Track crime and safety in your neighborhood