Police in Kansas arrested a robbery suspect late Saturday after a dramatic shootout that evening wounded a Topeka detective, local media reported.

The suspect also was wounded in the gunfire. The unnamed detective and another officer had spotted a man matching the description of the suspect in a convenience store robbery earlier in the day and were trying to detain him, WIBW reported.

One neighbor described hearing at least 25 gunshots. “It sounded like somebody set off a pack of firecrackers,” Bill Pickering told The Topeka Capital-Journal.

The detective was recovering from gunshot wounds to his abdomen and leg, Topeka Police spokesperson Colleen Stuart said, adding that the detective was in stable condition and expected to survive. Officials said the suspect's injuries were life-threatening.

Witnesses told police a man had flashed a handgun inside the convenience store and demanded cash before escaping.

Police said they spotted two men linked to the robbery in a car later that evening. They arrested 28-year-old Jermaine Patton and engaged in the gun battle with the other suspect, whom they did not immediately name.

Police placed the officers involved in the shootout on administrative leave, which is standard policy, WIBW added.