Mycoplasma agalactiae, the etiological agent of contagious agalactia of small ruminants, has a family of related genes (avg genes) which encode surface lipoprotein antigens that undergo phase variation. A series of 13 M. agalactiae clonal isolates, obtained from one chronically infected animal over a period of 7 months, were found to undergo major rearrangement events within the avg genomic locus. We show that these rearrangements regulate the phase-variable expression of individual avg genes. Northern blot analysis and reverse transcription-PCR showed that only one avg gene is transcribed, while the other avg genes are transcriptionally silent. Sequence analysis and primer extension experiments with two M. agalactiae clonal isolates showed that a specific 182-bp avg 5′ upstream region (avg-B2) that is present as a single chromosomal copy serves as an active promoter and exhibits a high level of homology with the vsp promoter of the bovine pathogen Mycoplasma bovis. PCR analysis showed that each avg gene is associated with the avg-B2 promoter in a subpopulation of cells that is present in each subclone. Multiple sequence-specific sites for DNA recombination (vis-like), which are presumably recognized by site-specific recombinase, were identified within the conserved avg 5′ upstream regions of all avg genes and were found to be identical to the recombination sites of the M. bovis vsp locus. In addition, a gene encoding a member of the integrase family of tyrosine site-specific recombinases was identified adjacent to the variable avg locus. The molecular genetic basis for avg phase-variable expression appears to be mediated by site-specific DNA inversions occurring in vivo that allow activation of a silent avg gene by promoter addition. A model for the control of avg genes is proposed.