CHP officers arrested two suspected gang members Sunday night and retrieved a gun one tossed during a traffic stop, CHP officials reported.

The man who officers said had the gun was caught after he ran onto campus at Cook Middle School on Sebastopol Road.

The two had been riding with a driver who ran a stoplight at Corporate Center Drive and Sebastopol Road at about 8:30 p.m., CHP Officer Kerri Post said.

A CHP officer let the driver know they should pull over, and the driver stopped in front of the school.

As the driver was stopping, two men got out of the car and ran in different directions. The man heading onto campus struggled with something in his waistband as he went, ignoring an officer's orders to stop.

The man eventually stopped and got to the ground. Officers arrested Edgar Andres Toscano, 19, of Santa Rosa on suspicion of several felony counts including being a felon with a gun and participating in a street gang crime. Post said Toscano was known to law enforcement as a member of a street gang.

They found a loaded .38-caliber revolver on the grass in front of the school along the path where he'd run.

Officers arrested the second passenger at 9:20 p.m., taking Miguel Flores, 22, of Santa Rosa into custody some blocks away.

Flores also is a gang member and was arrested on suspicion of resisting officers, public intoxication and gang enhancements, the CHP said.

Both were taken to the Sonoma County Jail.