Ultraviolet (UV)-screening compounds represent a substantial asset for the survival of cyanobacteria in extreme environments exposed to high doses of UV radiations on modern and early Earth. Among these molecules, the halochromic pigment gloeocapsin remains poorly characterized and studied. In this study, we identified a gloeocapsin-producing cultivable cyanobacteria: the strain Phormidesmis nigrescens ULC007. We succeeded to extract, to partially purify, and to compare the dark blue pigment from both the ULC007 culture and an environmental Gloeocapsa alpina dominated sample. FT-IR and Raman spectra of G. alpina and P. nigrescens ULC007 pigment extracts strongly suggested a common backbone structure. The high-pressure liquid chromatography-UV-MS/MS analysis of the ULC007 pigment extract allowed to narrow down the molecular formula of gloeocapsin to potentially five candidates within three classes of halochromic molecules: anthraquinone derivatives, coumarin derivatives, and flavonoids. With the discovery of gloeocapsin in P. nigrescens, the production of this pigment is now established for three lineages of cyanobacteria (including G. alpina, P. nigrescens, and Solentia paulocellulare) that belong to three distinct orders (Chroococcales, Pleurocapsales, Synechoccocales), inhabiting very diverse environments. This suggests that gloeocapsin production was a trait of their common ancestor or was acquired by lateral gene transfer. This work represents an important step toward the elucidation of the structure of this enigmatic pigment and its biosynthesis, and it potentially provides a new biosignature for ancient cyanobacteria. It also gives a glimpse on the evolution of UV protection strategies, which are relevant for early phototrophic life on Earth and possibly beyond.