The formation of biofilms is an important survival strategy allowing rhizobia to live on soil particles and plant roots. Within the microcolonies of the biofilm developed by Rhizobium leguminosarum, rhizobial cells interact tightly through lateral and polar connections, forming organized and compact cell aggregates. These microcolonies are embedded in a biofilm matrix, whose main component is the acidic exopolysaccharide (EPS). Our work shows that the O-chain core region of the R. leguminosarum lipopolysaccharide (LPS) (which stretches out of the cell surface) strongly influences bacterial adhesive properties and cell-cell cohesion. Mutants defective in the O chain or O-chain core moiety developed premature microcolonies in which lateral bacterial contacts were greatly reduced. Furthermore, cell-cell interactions within the microcolonies of the LPS mutants were mediated mostly through their poles, resulting in a biofilm with an altered three-dimensional structure and increased thickness. In addition, on the root epidermis and on root hairs, O-antigen core-defective strains showed altered biofilm patterns with the typical microcolony compaction impaired. Taken together, these results indicate that the surface-exposed moiety of the LPS is crucial for proper cell-to-cell interactions and for the formation of robust biofilms on different surfaces.