Agricultural practices have raised the level of nutrients reaching aquifers. In Europe, nitrate pollution is considered as one of the main threats for the quality of groundwater in agricultural areas. Treatment wetlands (TWs), also known as Constructed Wetlands, are used for groundwater treatment in areas with an important concentration of nitrogen compounds; total nitrogen removal depends on the type and operation scheme. Cork by-product from the industry has shown clear adsorbent properties to remove organic pollutants. The work is focused on the characterization of microbial communities involved in the nitrate‑nitrogen removal process in groundwater polluted from agricultural activities. The experimental design allowed the comparison of nitrate removal efficiency depending on the filter media material, cork by-product or gravel, used in two hybrid TWs (a vertical flow cell followed by a horizontal subsurface flow cell), installed in areas close to two irrigated agricultural plots at the Lleida plain area (Spain). Both physicochemical and microbial results were consistent and confirm the nitrate removal efficiency using cork as a filter media. A significant (p = 0.0025) higher removal in Bellvís TW using cork compared with the Vilanova de la Barca gravel system was observed, achieving a removal rate from 80 to 99% compared to the 5-46%, respectively. Regarding the community composition of the two different TWs, microorganisms were mainly related to the phylum Proteobacteria, and included members found to be key players in the nitrogen cycle, such as ammonia and nitrite oxidizers, as well as denitrifiers. Also, the group Bacteroidetes turns to be another abundant phylum from our bacterial dataset, whose members are suggested to be strongly involved in denitrification processes. Some groups showed to prevail depending on the type of media (cork or gravel); Firmicutes and Delta and Epsilonproteobacteria had a significant higher abundance in the TW with cork, while Acidobacteria and Planctomyces were prevalent in gravel. Therefore, cork could be an alternative material used by treatment wetlands to minimize the impact in the environment caused by nitrogen pollution in groundwater bodies.