A convicted felon tried to hide a gun with an extended magazine when officers arrived at a Saint Paul apartment building and it went off during his arrest, prosecutors say.

The bullet grazed the man’s leg, according to a criminal complaint filed this week.

Trey Jordan Ard, 27, of Minneapolis, faces two felony counts of possession of a firearm by an ineligible person.

Saint Paul police responded around 10:05 p.m. on March 14 to the 500 block of Broadway Street on a report of eight people pointing guns at each other. Dispatch also heard yelling and screaming during the 911 call, court documents say.