The budding yeast, Saccharomyces cerevisiae, has emerged as an archetype of eukaryotic cell biology. Here we show that S. cerevisiae is also a model for the evolution of cooperative behavior by revisiting flocculation, a self-adherence phenotype lacking in most laboratory strains. Expression of the gene FLO1 in the laboratory strain S288C restores flocculation, an altered physiological state, reminiscent of bacterial biofilms. Flocculation protects the FLO1 expressing cells from multiple stresses, including antimicrobials and ethanol. Furthermore, FLO1(+) cells avoid exploitation by nonexpressing flo1 cells by self/non-self recognition: FLO1(+) cells preferentially stick to one another, regardless of genetic relatedness across the rest of the genome. Flocculation, therefore, is driven by one of a few known "green beard genes," which direct cooperation toward other carriers of the same gene. Moreover, FLO1 is highly variable among strains both in expression and in sequence, suggesting that flocculation in S. cerevisiae is a dynamic, rapidly evolving social trait.