The fossil record for lichens is poor. The extreme habitats that lichens dominate, such as tundra, mountains, and deserts, are not ordinarily conducive to producing fossils. There are fossilized lichens embedded in amber. The fossilized Anzia is found in pieces of amber in northern Europe and dates back approximately 40 million years. Lichen fragments are also found in fossil leaf beds, such as Lobaria  from Trinity County in northern California, US, dating back to the early to middle Miocene.
The oldest fossil lichen in which both symbiotic partners have been recovered is Winfrenatia, an early zygomycetous (Glomeromycotan) lichen symbiosis that may have involved controlled parasitism, is permineralized in the Rhynie Chert of Scotland, dating from early Early Devonian, about 400 million years ago. The slightly older fossil Spongiophyton has also been interpreted as a lichen on morphological and isotopic grounds, although the isotopic basis is decidedly shaky. It has been demonstrated that Silurian-Devonian fossils Nematothallus and Prototaxites were lichenized. Thus lichenized Ascomycota and Basidiomycota were a component of Early Silurian-Devonian terrestrial ecosystems. Newer research suggests that lichen evolved after the evolution of land plants.
The ancestral ecological state of both Ascomycota and Basidiomycota was probably saprobism, and independent lichenization events may have occurred multiple times. In 1995, Gargas and colleagues proposed that there were at least five independent origins of lichenization; three in the basidiomycetes and at least two in the Ascomycetes. Lutzoni et al. (2001) suggest lichenization probably evolved earlier and was followed by multiple independent losses. Some non-lichen-forming fungi may have secondarily lost the ability to form a lichen association. As a result, lichenization has been viewed as a highly successful nutritional strategy.
Lichenized Glomeromycota may extend well back into the Precambrian. Lichen-like fossils consisting of coccoid cells (cyanobacteria?) and thin filaments (mucoromycotinan Glomeromycota?) are permineralized in marine phosphorite of the Doushantuo Formation in southern China. These fossils are thought to be 551 to 635 million years old or Ediacaran. Ediacaran acritarchs also have many similarities with Glomeromycotan vesicles and spores. It has also been claimed that Ediacaran fossils including Dickinsonia, were lichens, although this claim is controversial. Endosymbiotic Glomeromycota comparable with living Geosiphon may extend back into the Proterozoic in the form of 1500 million year old Horodyskia and 2200 million year old Diskagma. Discovery of these fossils suggest that fungi developed symbiotic partnerships with photoautotrophs long before the evolution of vascular plants, though the Ediacaran lichen hypothesis is largely rejected due to an inappropriate definition of lichens based on taphonomy and substrate ecology. However, a 2019 study by the same scientist who rejected the Ediacaran lichen hypothesis, Nelsen, used new time-calibrated phylogenies to conclude that there is no evidence of lichen before the existence of vascular plants.
Lecanoromycetes, one of the most common classes of lichen-forming fungi, diverged from its ancestor, which may have also been lichen forming, around 258 million years ago, during the late Paleozoic period. However, the closely related clade Euritiomycetes appears to have become lichen-forming only 52 million years ago, during the early Cenozoic period.