(Reuters) - A suspected gunman was shot dead and 22 people were injured on Sunday after a dispute among rival gangs erupted into gunfire at an all-night arts festival in Trenton, New Jersey, officials said.

One of the shooting victims was a 13-year-old boy who was in extremely critical condition, Mercer County Prosecutor Angelo Onofri told a news conference. Three others were in critical condition.

At least two people opened fire around 2:45 a.m. at the annual Art All Night event in Trenton, about 60 miles (100 km) southwest of New York City.

The dead suspect was identified by police as Tahaij Wells, 33, and another suspect, Amir Armstrong, 23, was in police custody.

Of the 22 people injured, 17 people of them were shot, Onofri said, and multiple weapons were recovered from the scene.

Officials believe the suspect was killed by police, and the case was being treated as an officer-involved shooting, Onofri said.

More than 1,000 people were believed to have been at the festival when the violence started.

Slideshow ( 3 images )

“It absolutely could have been worse, given the confined space and the number of shots that appear to have been fired,” Onofri told a news conference.

“The shooting appears to be related to several neighborhood gangs from here in the city of Trenton having a dispute at the venue,” Onofri said.

Organizers canceled the remainder of the event, billed as “24 hours of community, creativity and inspiration.”

The festival typically draws more than 30,000 visitors to view work from more than 1,500 artists as well as exhibitions of glass blowing and woodwork, The Trentonian reported on its website. About 50 bands also play on three stages.

“We’re still processing much of this and we don’t have many answers at this time but please know that our staff, our volunteers, our artists and musicians all seem to be healthy and accounted for,” the organizers wrote on Facebook on Sunday. “Our sincere, heartfelt sympathies are with those who were injured.”

The New Jersey shooting occurred amid a debate about U.S. gun laws that was given fresh impetus by the massacre in February of 17 people at a high school in Parkland, Florida.

“It is a fact that our cities as well as our suburbs throughout America are experiencing an increase in public shootings and public unrest such as this,” Trenton Mayor Eric Jackson told the news conference. “This isn’t just a random act of violence. This is a public health issue.”

New Jersey Governor Phil Murphy spoke at a Trenton church on Sunday, noting that he signed six gun control bills into law on Wednesday but saying the proliferation of guns required a national solution.

“Congress needs to act,” Murphy said.