Coastal marine lagoons are environments highly vulnerable to anthropogenic pressures such as agriculture nutrient loading or runoff from metalliferous mining. Sediment microorganisms, which are key components in the biogeochemical cycles, can help attenuate these impacts by accumulating nutrients and pollutants. The Mar Menor, located in the southeast of Spain, is an example of a coastal lagoon strongly altered by anthropic pressures, but the microbial community inhabiting its sediments remains unknown. Here, we describe the sediment prokaryotic communities along a wide range of environmental conditions in the lagoon, revealing that microbial communities were highly heterogeneous among stations, although a core microbiome was detected. The microbiota was dominated by Delta- and Gammaproteobacteria and members of the Bacteroidia class. Additionally, several uncultured groups such as Asgardarchaeota were detected in relatively high proportions. Sediment texture, the presence of Caulerpa or Cymodocea, depth, and geographic location were among the most important factors structuring microbial assemblages. Furthermore, microbial communities in the stations with the highest concentrations of potentially toxic elements (Fe, Pb, As, Zn, and Cd) were less stable than those in the non-contaminated stations. This finding suggests that bacteria colonizing heavily contaminated stations are specialists sensitive to change.