A St. Paul man accidentally shot himself in the stomach on Saturday while trying to flee police, authorities said.

Demetrice D. Miller, 29, was charged Tuesday in Ramsey County District Court with three counts of illegal possession of a firearm. Miller, who remains in recovery at Regions Hospital, is a convicted felon and not permitted to carry a gun.

The incident began when St. Paul officers with the city's gun violence detail conducted a traffic stop near the intersection of Blair Avenue and Victoria Street around 5 p.m. in West Frogtown. The front seat passenger, later identified as Miller, exited the vehicle and ran away.

An officer who chased Miller through the alley behind the 800 block of Blair Avenue heard a gunshot. Police soon located Miller, who now had a gunshot wound to his torso. Two firearms lay nearby. One contained a spent round of ammunition, charges say.

"Just the two guns — nothing more?" an officer asked Miller, according to the criminal complaint. "Those were all I had, man," Miller replied.

Miller told paramedics that pursuing officers had shot him — a claim police deny. Body camera footage of the chase does not show the responding officer firing his weapon, court records say.

Two law enforcement sources with knowledge of the investigation told the Star Tribune that Miller accidentally shot himself while trying to ditch his guns.

Miller has six previous felony convictions, including three for domestic assault. Once released from the hospital, he is expected to be booked into Ramsey County jail on a felony warrant.