Self and kin discrimination are observed in most kingdoms of life and are mediated by highly polymorphic plasma membrane proteins. Sequence polymorphism, which is essential for effective recognition, is maintained by balancing selection. Dictyostelium discoideum are social amoebas that propagate as unicellular organisms but aggregate upon starvation and form fruiting bodies with viable spores and dead stalk cells. Aggregative development exposes Dictyostelium to the perils of chimerism, including cheating, which raises questions about how the victims survive in nature and how social cooperation persists. Dictyostelids can minimize the cost of chimerism by preferential cooperation with kin, but the mechanisms of kin discrimination are largely unknown. Dictyostelium lag genes encode transmembrane proteins with multiple immunoglobulin (Ig) repeats that participate in cell adhesion and signaling. Here, we describe their role in kin discrimination. We show that lagB1 and lagC1 are highly polymorphic in natural populations and that their sequence dissimilarity correlates well with wild-strain segregation. Deleting lagB1 and lagC1 results in strain segregation in chimeras with wild-type cells, whereas elimination of the nearly invariant homolog lagD1 has no such consequences. These findings reveal an early evolutionary origin of kin discrimination and provide insight into the mechanism of social recognition and immunity.