One suspect is being held in jail pending a dangerousness hearing and three others also charged with possession of a firearm without a license were ordered held on cash bail of no less than $2,500 following hearings in Lynn District Court on Monday.
A fifth suspect, the driver, was released on personal recognizance.
The suspects were in a blue '93 Saab with New Hampshire plates stopped in Swampscott early Sunday morning by Swampscott police and a Lynn officer, according to the prosecution.
The Swampscott officer found a handgun in the car after he saw movement, including furtive moves, by occupants in the backseat, the prosecutor said. The officer discovered the gun after the occupants were ordered from the vehicle.
Judge Stacey Fortes-White found probable cause for the arrest of individuals in the car.
They are passengers Benjamin Alford, 32, of Dorchester, Darell Flint, 24, of Boston, Robert Hood, 31, of Quincy, Andre Spriggs, 27, of Dorchester and driver Katie Torres, 30, of Dorchester.
Flint faces the dangerousness hearing.
Flint told police that he fired a shot in the air outside a Lynn party, an assistant district attorney told the judge.
The suspects were given gun residue tests following their arrests but the results were not available at the time of Monday's hearing.
They were stopped by police on Paradise Road by Vinnin Square in Swampscott, according to the prosecution.
The Swampscott police officer found the handgun inside a sock on the floor in the area where Flint was sitting, the prosecution said.
There were six spent shell casings in the handgun.
Police had been alerted to a report of shots fired outside a party in Lynn in the area of Cherry and Nicholas streets.
The shots were fired following an argument at the party, according to the prosecution.
Witnesses said a tall black man had fired a shot in the air, then they hit the ground to avoid the possibility of being hit, the prosecution said.
The driver of the Saab told police that she thought the shooter had dropped the gun on the ground, after she saw him fire a shot in the air, according to a statement cited in court.
The driver told police that the group had been to a club in Salem to celebrate a brithday and the party moved to a Lynn location after hours.
People were drunk and there was an argument at the party, she said.
At some point an undercover Lynn police officer followed a vehicle with New Hampshire plates that matched the description of a vehicle seen leaving the party with a suspect in it.
The vehicle traveled to Swampscott where the Swampscott officer pulled it over.
In court Monday lawyers for four of the five defendants — all except for Flint — argued strenuously that there was no probable cause for the arrest of their clients since they were not tall, and, in the instance of Torres, neither black nor a male.
The lawyers for Alford, Hood, Spriggs and Torres also argued that there were statements given indicating that the gun was not fired by those four defendants.
The judge found probable cause for their arrests, saying the circumstances and the potential for serious penalties merited the cases against them moving forward in court.
Flint's case was continued to Oct 5.
The others were ordered to appear for a pretrial hearing on Oct. 31.
Torres had made bail earlier in the day, and the remaining defendants were to be transported to Middleton jail.