Sulphoquinovosyldiacylglycerols (SQDG) are polar sulphur-containing membrane lipids, whose presence has been related to a microbial strategy to adapt to phosphate deprivation. In this study, we have targeted the sqdB gene coding the uridine 5'-diphosphate-sulphoquinovose (UDP-SQ) synthase involved in the SQDG biosynthetic pathway to assess potential microbial sources of SQDGs in the marine environment. The phylogeny of the sqdB-coding protein reveals two distinct clusters: one including green algae, higher plants and cyanobacteria, and another one comprising mainly non-photosynthetic bacteria, as well as other cyanobacteria and algal groups. Evolutionary analysis suggests that the appearance of UDP-SQ synthase occurred twice in cyanobacterial evolution, and one of those branches led to the diversification of the protein in members of the phylum Proteobacteria. A search of homologues of sqdB-proteins in marine metagenomes strongly suggested the presence of heterotrophic bacteria potential SQDG producers. Application of newly developed sqdB gene primers in the marine environment revealed a high diversity of sequences affiliated to cyanobacteria and Proteobacteria in microbial mats, while in North Sea surface water, most of the detected sqdB genes were attributed to the cyanobacterium Synechococcus sp. Lipid analysis revealed that specific SQDGs were characteristic of microbial mat depth, suggesting that SQDG lipids are associated with specific producers.