Boston police seized a loaded firearm and seven bags of crack cocaine from a Boston cab’s passengers on Saturday.

The two suspects, 19-year-old Dijuan Beasley, of Dorchester, and 20-year-old Tyshawn Cummings, of Dorchester, were known to the department after past gun-related arrests, according to a police report.

Officers assigned to the Youth Violence Strike Force followed a taxi after spotting Beasley and Cummings – who allegedly had been clutching at his waistband – as they entered the vehicle, police said.

After stopping the cab for what was described as a “traffic infraction,” police pulled the vehicle over, according to the report. Inside, police found a loaded Beretta 9mm handgun with an “obliterated serial number.”

RELATED: Roxbury teen shot dead near Boston Police headquarters

Police also found seven bags of crack cocaine in Beasley’s possession, the report said.

Officers arrested the men in the area of 150 Norwell St. in Dorchester around 12:15 p.m., according to the report.

Both men were set to appear in Dorchester District Court. Cummings faces weapons charges and Beasley faces both weapons and drug charges.