Estuarine ecosystems interconnect freshwater and marine environments, and comprise multiple highly dynamic and complex microhabitats. The resident microbiota in estuary is influenced by contrasting microenvironmental heterogeneity. However, the bacterial patterns and assembly processes in different microhabitats of estuarine ecosystem are not well studied. Here, we investigated the bacterial diversity, functions and community assembly mechanisms of mangrove soil, river sediment and overlying water in a subtropical estuary. Results showed that similar profiles of bacterial communities existed in the mangrove soil and river sediment and were dominated by Proteobacteria, Bacteroidetes and Acidobacteria. In terms of different microhabitats, the lowest alpha diversity of bacterial communities was found in overlying water and were dominated by Proteobacteria, Actinobacteria and Bacteroidetes. Meanwhile, the functional potential genes associated with carbon metabolisms were also substantially different in the three microhabitats. The relative abundance of genes connected to aerobic carbon respiration was significantly higher in overlying water than in the other two microhabitats. Bacterial communities in river sediments were enriched for genes associated with aerobic methane oxidation. The strong environmental heterogeneity of the three nearby microhabitats shaped the taxonomic and functional composition of the bacterial communities in estuarine ecosystem. Moreover, the plant rhizosphere effect increased the proportion of the dispersal limitation processes in mangrove soils compared to that in river sediments, while the overlying water was fluid and had less environmental selection processes compared to that in mangrove soil and river sediment. The bacterial communities in river sediment construct a more clustered network, while the overlying water network showed the highest complexity. Our findings reveal the differences of bacterial patterns and community assembly mechanisms in distinct microhabitats of estuarine ecosystems, and provide important insights for a comprehensive understanding of the mechanisms to maintain estuarine wetland conservation under environmental changes.