STATEN ISLAND, N.Y. — A 17-year-old boy tossed a gun away as he tried to flee from a traffic stop in Stapleton, police allege.

The incident occurred around 11 p.m. on the 100 block of Tompkins Avenue near Broad Street, according to a spokesperson for the NYPD.

The episode began when officers noticed the teen was not wearing a seat belt while riding in the backseat of a Toyota Camry.

As officers attempted to stop the vehicle, the teen fled from the Toyota and tossed the gun to the ground, the NYPD said.

The officers gave chase on foot and apprehended the suspect after a brief pursuit.

The gun was recovered at the scene.

Police charged the boy with criminal possession of a weapon, resisting arrest and obstructing governmental administration.

The NYPD does not disclose the identities of minors.