Gunmen have opened fire at an all-night arts and music festival in New Jersey, sending people running over each other in the scramble to safety, authorities said.

One suspect was killed and 22 people, including two suspects, were injured.

Of 17 people treated for gunshot wounds, four of them, including a 13-year-old boy, were critically injured but three had been upgraded to stable by evening, leaving only one man believed to be a suspect in critical condition, Mercer County Prosecutor Angelo Onofri.

The shots rang out as an estimated 1,000 or more people were attending the Art All Night Trenton festival that showcases local art, music, food and films.

Mr Onofri said numerous fights inside and outside had prompted police to tell organisers that the event needed to be shut down because “there was a report that the mood inside the venue had been changing”.

Organisers were in the process of doing that when the shooting started, he said.

Art All Night Shooting Trenton
Multiple people were wounded early on Sunday (Paige Gross/NJ.com/The Star-Ledger via AP)

Authorities believe several neighbourhood gangs had a dispute at the venue, and multiple suspects began shooting at each other, with police returning fire, Mr Onofri said.

Tahaij Wells, 33, the suspect who was killed, had recently been released from prison and was on parole since February on homicide-related charges, Mr Onofri said.

Amir Armstrong, 23, listed in stable condition, was charged with a weapons offence. It was not immediately known if he had a lawyer who could comment.

Multiple weapons were confiscated, including a handgun with an extended capacity magazine containing more ammunition than is allowed under New Jersey law, Mr Onofri said.

On Sunday, crime scene tape surrounded the site of the historic Roebling Wire Works Building that now shares a parking lot with a supermarket, bank and laundry.

Police were also investigating an attempted carjacking that occurred in a nearby alley.

Mr Onofri said police were working to determine if it is connected to the shooting.

Gennie Darisme was getting ready to leave the festival when she heard shots and saw people running.

“There were people trampling other people, cars hitting other cars,” she said.

When she was walking back to her car after the shots stopped, Ms Darisme said she saw someone bleeding on the ground, in handcuffs.

“People were running to him, trying to see his face, to see if he’s a family member or a friend,” she said.

Theresa Brown, who has been volunteering at Art All Night for 12 years, said she was leaving her volunteer shift when she heard “pop, pop, pop. I thought it was a car backfiring,” she said.

The remainder of the two-day festival has been cancelled.

“We’re very shocked. We’re deeply saddened. Our hearts ache and our eyes are blurry but our dedication and resolve to building a better Trenton through community, creativity and inspiration will never fade. Not tonight. Not ever,” festival organisers posted on social media.

The injured were taken to area hospitals, where some had been treated and released.

Trenton Mayor Eric E Jackson said the violence cannot be “discarded as just random violence; this is a public health issue”.