Police say they spotted Demetrius Williams running out of a store with a gun in his hand in the 700-block of East 83rd Street at about 2:22 a.m. Friday morning in the Chatham neighborhood.
Officers say they began to pursue Williams as he ran westbound on 83rd Street. Williams then allegedly turned around and began firing at a squad car, and officers returned gunfire.
Williams was then taken into custody and no one was injured in the incident, police say.
A handgun was recovered from the scene and detectives are investigating, according to officials.
Williams is due in bond court Saturday.