Ribonuclease (RNase) T2 genes are found widely in both eukaryotes and prokaryotes, and genes from this family have been revealed to have various functions in plants. In particular, S-RNase is known to be the female determinant in the S-RNase-based gametophytic self-incompatibility system. However, the origin and evolution of the RNase T2 gene family and gametophytic self-incompatibility system are not well understood. In this study, 785 RNase T2 genes were identified in 81 sequenced plant genomes representing broad-scale diversity, and divided into three subgroups (Class I, II, and III) based on phylogenetic and synteny network analysis. Class I was found to be of ancient origin and to emerge in green algae, Class II was shown to originate with the appearance of angiosperms, while Class III was discovered to be eudicot-specific. Each of three major classes could be further classified into several subclasses of which some subclasses were found to be lineage-specific. Furthermore, duplication, deletion, or inactivation of the S/S-like-locus was revealed to be linked to repeated loss and gain of self-incompatibility in different species from distantly related plant families with gametophytic self-incompatibility. Finally, the origin and evolutionary history of S-locus in Rosaceae species was unraveled with independent loss and gain of S-RNase occurred in different subfamilies of Rosaceae. Our findings provide insights into the origin and evolution of the RNase T2 family and the gametophytic self-incompatibility system in plants.