Two microbial mats found inside two old (gold and uranium) mines in Zloty Stok and Kowary located in SW Poland seem to form a natural barrier that traps heavy metals leaking from dewatering systems. We performed complex physiological and metagenomic analyses to determine which microorganisms are the main driving agents responsible for self-purification of the mine waters and identify metabolic processes responsible for the observed features. SEM and energy dispersive X-ray microanalysis showed accumulation of heavy metals on the mat surface, whereas, sorption experiments showed that neither microbial mats were completely saturated with heavy metals present in the mine waters, indicating that they have a large potential to absorb significant quantities of metal. The metagenomic analysis revealed that Methylococcaceae and Methylophilaceae families were the most abundant in both communities, moreover, it strongly suggest that backbones of both mats were formed by filamentous bacteria, such as Leptothrix, Thiothrix, and Beggiatoa. The Kowary bacterial community was enriched with the Helicobacteraceae family, whereas the Zloty Stok community consist mainly of Sphingomonadaceae, Rhodobacteraceae, and Caulobacteraceae families. Functional (culture-based) and metagenome (sequence-based) analyses showed that bacteria involved in immobilization of heavy metals, rather than those engaged in mobilization, were the main driving force within the analyzed communities. In turn, a comparison of functional genes revealed that the biofilm formation and heavy metal resistance (HMR) functions are more desirable in microorganisms engaged in water purification than the ability to utilize heavy metals in the respiratory process (oxidation-reduction). These findings provide insight on the activity of bacteria leading, from biofilm formation to self-purification, of mine waters contaminated with heavy metals.