Nashua police said many of the 13 people arrested in connection with the April 26 incident have gang ties. Police said the investigation took more than a month and involved the FBI's Safe Streets task force.

"It's the safety of the community that we're concerned about, with the alleged illegal gang activity that was going on here in the city of Nashua," prosecutor Evie King said.

Police said the fight took place near the corner of Pine and Lemoine streets. During the confrontation, police said, Travis McPherson, 19, fired at least two shots into a crowd of people, hitting a man in the leg. McPherson faces four charges that include first-degree assault.

The man he's accused of shooting, Eric Roman, 24, was one of eight people to go before a judge Tuesday on riot charges.

"Not everyone that was arrested in this incident has an official tie to a gang," Lt. James Testaverde said. "There are several people involved with the incident who do have gang affiliations."

In court documents, police said that when they searched the scene, they found several weapons that included a tire iron, a crowbar and a bat with nails sticking out of it.

The judge set differing bail amounts based on the defendants' past criminal records, but there were conditions imposed on all of them. The suspects were ordered to be home between 11 p.m. and 6 a.m. and not to have any contact with each other.

Police said the investigation is not over, and they anticipate more arrests.