Metal corrosion is of worldwide concern because it is the cause of major economic losses, and because it creates significant safety issues. The mechanism of the corrosion process, as influenced by bacteria, has been studied extensively. However, the bacterial communities that create the biofilms that form on metals are complicated, and have not been well studied. This is why we sought to analyze the composition of bacterial communities living on steel structures, together with the influence of ecological factors on these communities. The corrosion samples were collected from rust layers on steel plates that were immersed in seawater for two different periods at Sanya and Xiamen, China. We analyzed the bacterial communities on the samples by targeted 16S rRNA gene (V3–V4 region) sequencing using the Illumina MiSeq. Phylogenetic analysis revealed that the bacteria fell into 13 phylotypes (similarity level = 97%). Proteobacteria, Firmicutes and Bacteroidetes were the dominant phyla, accounting for 88.84% of the total. Deltaproteobacteria, Clostridia and Gammaproteobacteria were the dominant classes, and accounted for 70.90% of the total. Desulfovibrio spp., Desulfobacter spp. and Desulfotomaculum spp. were the dominant genera and accounted for 45.87% of the total. These genera are sulfate-reducing bacteria that are known to corrode steel. Bacterial diversity on the 6 months immersion samples was much higher than that of the samples that had been immersed for 8 years (P < 0.001, Student’s t-test). The average complexity of the biofilms from the 8-years immersion samples from Sanya was greater than those from Xiamen, but not significantly so (P > 0.05, Student’s t-test). Overall, the data showed that the rust layers on the steel plates carried many bacterial species. The bacterial community composition was influenced by the immersion time. The results of our study will be of benefit to the further studies of bacterial corrosion mechanisms and corrosion resistance.