The officer was walking in the 1900-block of West Belmont Avenue when he was held-up two armed men who were wearing masks, officials said. One of the suspects fired his gun, and the officer shot back, according to officials.
"You just heard four really loud gunshots. That's what I said to myself. Then you heard what sounded like five or six pops," Randy Smock said.
The robbers ran away with the officer's cell phone and cash. No one is in custody.
The off-duty deputy was not injured. But investigators found blood in a nearby alley, which could indicate one of the robbers may have been wounded.
ABC7 Exclusive: Surveillance video of Roscoe Village shooting
Surveillance video from a nearby store shows one of the two masked suspects running south on Wolcott Avenue. The second suspect turns and fires at the off-duty officer, who cannot be seen on the video, and then runs away.
Two windows were shot out at Jahn Elementary School, which is just across the street.
"The fact that it was near the school is discomforting, but it was overnight so it was not like there were any kids here and I'm totally confident in the people inside the school keeping the kids safe," Matt DiMarco, whose daughter attends Jahn, said.
"You just kind of forget that this is a city and these things happen, and that's it. I just cannot believe it happened here," Courtney Read said.
Police are also reviewing another surveillance video from a neighbor's house.