The O-polysaccharide chain of the lipopolysaccharide (O-antigen) on the bacterial cell surface is one of the most structurally variable cell components and serves as a basis for serotyping of Gram-negative bacteria, including human opportunistic pathogens of the genus Providencia. In this work, the O-antigen of Providencia alcalifaciens O40 was obtained by mild acid degradation of the isolated lipopolysaccharide and studied by chemical methods and high-resolution NMR spectroscopy. The following structure of the O-polysaccharide was established: →4)-β-d-Quip3NFo-(1→3)-α-d-Galp-(1→3)-β-d-GlcpA-(1→3)-β-d-GalpNAc-(1→, where GlcA stands for glucuronic acid and Qui3NFo for 3,6-dideoxy-3-formamidoglucose. The O40-antigen was found to be structurally and serologically related to the O-antigens of P. alcalifaciens O5 and Providencia stuartii O18. The O40-antigen gene cluster between cpxA and yibK was sequenced, and the gene functions were predicted in silico. In agreement with the O-polysaccharide structure established, the genes for the synthesis of dTDP-d-Qui3NFo, UDP-d-Gal, UDP-d-GlcA, and UDP-d-GalNAc as well as those encoding three glycosyltransferases, flippase (Wzx), and O-antigen polymerase (Wzy) were recognized. In addition, homologues of wza, wzb, and wzc genes, which are required for the surface expression of capsular polysaccharides, were found within the gene cluster, suggesting that the O-polysaccharide studied is a part of the capsule-related form of the lipopolysaccharide called KLPS.