In this study, we investigated the abundance and diversity of bacteria in the digestive tract of the bivalve mollusks Unio pictorum after 30-day exposure in experimental cages and field-collected gastropod mollusk Radix balthica in the eastern Gulf of Finland, Baltic Sea. Contamination of water and sediments with petroleum hydrocarbons had a significant impact on the intestinal bacterial community of mollusks stimulating the growth of hydrocarbon-oxidizing bacteria. The abundance of the intestinal hydrocarbon-oxidizing bacteria correlated with the concentration of the total hydrocarbons in the water of the coastal sites in the Gulf, where the mollusks were exposed. Metagenomic analysis revealed significant differences in the intestinal microbial community composition between polluted and unpolluted sites. The increased abundance of members of the phylum Gammaproteobacteria, including species of Aeromonas, Acinetobacter, Arenimonas, Pseudomonas, Rheinheimera, and Shewanella, and Bacteroidetes (Flavobacterium and Pedobacter) in the intestinal tracts of mollusks Unio pictorum were found at hydrocarbon-contaminated site: therefore, these bacteria are key players in the adaptation of intestinal community to this kind of pollution and hydrocarbon degradation. Our study suggests that hydrocarbon-oxidizing bacteria have the potential as a sensitive bioindicator for the further monitoring and ecological assessment of marine ecosystems.