In petroleum production, microbial research has been widely carried out to serve different engineering applications. For instance, studies on microbial-induced corrosion (MIC) control and microbial-enhanced oil recovery (MEOR) focus on the microbial activities in surface pipelines and in subsurface strata (oil reservoirs), respectively. However, the living microorganisms attaching to the inner surfaces of vertical wells as biofilms has not attracted much attention In a normal water-flooded oil-production system, the water is transferred between the surface and subsurface reservoirs through the vertical wells so that the wellbore biofilms are able to constantly affect the surface and subsurface communities. Therefore, it is necessary to reveal the structure and function of the sessile community along the vertical wellbore. Since in situ sampling from underground vertical wells is technologically complex and expensive, in this study, biofilm samples were obtained during well workover from well tube segments corresponding to different original depths (approximately 0 m, 300 m, 800 m, and 1300 m). Moreover, the injection water was also sampled. The results of 16S rRNA gene library sequencing showed that the microbial community in the water phase was distinct from that found in the biofilms (dissimilarity 0.63–0.78), although they shared 200–272 OTUs. At the phylum level, the dominant phylum, Euryarchaeota , accounted for 21.5%–35.8% in the four biofilms, while only 11.7% in the water phase. Proteobacteria was the dominant phylum in the water phase (74.6%), while accounted for only 7.7%–20.1% in the biofilms. With increasing depth from 0 m to 1300 m, the richness and diversity of biofilms declined (Chao index of 608.8 to 442.4, Shannon index of 4.01 to 3.48), and the bacterial abundance of biofilms declined from 78.4% to 63.5%, while the archaeal abundance increased from 21.6% to 36.5%. The geothermal gradient, depleted oxygen and even turbulence were the significant factors affecting the depth-dependent variation in the communities. For instance, the relative abundance of the hydrogenotrophic genera increased from 8.62% to 28.8% with increasing depth. In addition, the sudden variation of wellbore biofilms suggested a presumed boundary of the microbial ecosystem around the depth of 1000 m, which is consistent with existing reports. This is the first study to directly investigate and reveal the depth-dependent distribution of the wellbore community along a deep well (depth >1300 m). The distinct and depth-dependent communities suggested that direct investigation is necessary for completely understanding and efficiently controlling microbial activities in oil production processes, including MIC control and MEOR. • Biofilms at different depths from an injection well were sampled during workover. • There are abundant microorganisms living in wellbore environments as biofilms. • Biofilm communities show a depth-dependent distribution along the deep well. • Those biofilms interact with the entire oil production system by fluid circulation. • Understanding wellbore biofilm is essential for corrosion control and oil recovery.