Microbial genomes are thought to be mosaic, making it difficult to decipher how these genomes have evolved. Whole-genome nearest-neighbor analysis was applied to the Sinorhizobium meliloti pSymB replicon to determine its origin, the degree of horizontal transfer, and the conservation of gene order. Prediction of the nearest neighbor based on contextual information, i.e., the nearest phylogenetic neighbor of adjacent genes, provided useful information for genes for which phylogenetic relationships could not be established. A large portion of pSymB genes are most closely related to genes in the Agrobacterium tumefaciens linear chromosome, including the rep and min genes. This suggests a common origin for these replicons. Genes with the nearest neighbor from the same species tend to be grouped in "patches". Gene order within these patches is conserved, but the content of the patches is not limited to operons. These data show that 13% of pSymB genes have nearest neighbors in species that are not members of the Rhizobiaceae family (including two archaea), and that these likely represent genes that have been involved in horizontal transfer. Key words: Sinorhizobium meliloti, horizontal transfer, pSymB evolution.