Saccharomyces cerevisiae has a complex system for switching the mating type of haploid cells, requiring the genome to have three mating-type (MAT)-like loci and a mechanism for silencing two of them. How this system originated is unknown, because the threelocus system is present throughout the family Saccharomycetaceae, whereas species in the sister Candida clade have only one locus and do not switch. Here we show that yeasts in a third clade, the methylotrophs, have a simpler two-locus switching system based on reversible inversion of a section of chromosome with MATa genes at one end and MATalpha genes at the other end. In Hansenula polymorpha the 19-kb invertible region lies beside a centromere so that, depending on the orientation, either MATa or MATalpha is silenced by centromeric chromatin. In Pichia pastoris, the orientation of a 138-kb invertible region puts either MATa or MATalpha beside a telomere and represses transcription of MATa2 or MATalpha2. Both species are homothallic, and inversion of their MAT regions can be induced by crossing two strains of the same mating type. The three-locus system of S. cerevisiae, which uses a nonconservative mechanism to replace DNA at MAT, likely evolved from a conservative two-locus system that swapped genes between expression and nonexpression sites by inversion. The increasing complexity of the switching apparatus, with three loci, donor bias, and cell lineage tracking, can be explained by continuous selection to increase sporulation ability in young colonies. Our results provide an evolutionary context for the diversity of switching and silencing mechanisms.Hansenula polymorpha | Pichia pastoris | yeast genetics | comparative genomics M ating-type switching in yeasts is a highly regulated process that converts a haploid cell of one mating type into a haploid of the opposite type (1-5). Switching involves the complete deactivation of one set of regulatory genes and activation of an alternative set, but, unlike most regulatory changes, the switch is achieved by physically replacing the DNA at an expression site that is shared by both types of cell. In Saccharomyces cerevisiae the switching system uses a menagerie of molecular components (3) including three mating-type (MAT)-like loci (the expressed MAT locus and the silent loci HML and HMR); an endonuclease (HO) that creates a double-strand break at the MAT locus, which then is repaired using HMLalpha or HMRa as a donor; a mechanism (Sir1 and Sir2/3/4 proteins) for repressing transcription and HO cleavage at the silent loci; two triplicated sequences (the Z and X regions) that guide repair of the dsDNA break; a donorbias mechanism (the recombination enhancer, RE) to ensure that switching happens in the correct direction; and a cell lineagetracking mechanism (Ash1 mRNA localization) to ensure that switching occurs only in particular cells. Most of these components have no function other than facilitating switching.