We investigate the genetic structure and molecular selection pattern of a sympatric population of Sinorhizobium meliloti and Sinorhizobium medicae. These bacteria fix nitrogen in association with plants of the genus Medicago. A set of 116 isolates were obtained from a soil sample, from root nodules of three groups of plants representing among-species, within-species and intraline diversity in the Medicago genus. Bacteria were characterized by sequencing at seven loci evenly distributed along the genome of both Sinorhizobium species, covering the chromosome and the two megaplasmids. We first test whether the diversity of host plants influence the bacterial diversity recovered. Using the same data set, we then analyse the selective pattern at each locus. There was no relationship between the diversity of Medicago plants that were used for sampling and the diversity of their symbionts. However, we found evidence of selection within each of the two main symbiotic regions, located on the two different megaplasmids. Purifying selection or a selective sweep was found to occur in the nod genomic region, which includes genes involved in nodulation specificity, whereas balancing selection was detected in the exo region, close to genes involved in exopolysaccharide production. Such pattern likely reflects the interaction between host plants and bacterial symbionts, with a possible conflict of interest between plants and cheater bacterial genotypes. Recombination appears to occur preferentially within and among loci located on megaplasmids, rather than within the chromosome. Thus, recombination may play an important role in resolving this conflict by allowing different selection patterns at different loci.