Identification of two classes of gamma-ray bursts