(CNN) Twenty-two people, including a teenager, were injured early Sunday in a shooting at a 24-hour art festival in Trenton, New Jersey, the Mercer County Prosecutor's Office said.

Tahaij Wells

Amir "Mir" Armstrong

Police identified the suspect as Tahaij Wells, 33, who is believed to have been killed by police, prosecutor Angelo Onofri said. Wells had just been released from prison on homicide-related charges, Onofri said. Officials have also charged Amir Armstrong, 23, on weapons offenses.

"It absolutely could have been worse given the confined space and the number of shots that appear to have been fired," Onofri said.

The shooting appears to be the result of a gang dispute, he said. It is not related to terrorism.

Prior to the shooting, Onofri said there were "numerous altercations" inside and outside the festival. Police had been trying to shut the festival down.

Read More