Structural colors are generated by scattering of light by variations in tissue nanostructure. They are widespread among animals and have been studied most extensively in butterflies and moths (Lepidoptera), which exhibit the widest diversity of photonic nanostructures, resultant colors, and visual effects of any extant organism. The evolution of structural coloration in lepidopterans, however, is poorly understood. Existing hypotheses based on phylogenetic and/or structural data are controversial and do not incorporate data from fossils. Here we report the first example of structurally colored scales in fossil lepidopterans; specimens are from the 47-million-year-old Messel oil shale (Germany). The preserved colors are generated by a multilayer reflector comprised of a stack of perforated laminae in the scale lumen; differently colored scales differ in their ultrastructure. The original colors were altered during fossilization but are reconstructed based upon preserved ultrastructural detail. The dorsal surface of the forewings was a yellow-green color that probably served as a dual-purpose defensive signal, i.e. aposematic during feeding and cryptic at rest. This visual signal was enhanced by suppression of iridescence (change in hue with viewing angle) achieved via two separate optical mechanisms: extensive perforation, and concave distortion, of the multilayer reflector. The fossils provide the first evidence, to our knowledge, for the function of structural color in fossils and demonstrate the feasibility of reconstructing color in non-metallic lepidopteran fossils. Plastic scale developmental processes and complex optical mechanisms for interspecific signaling had clearly evolved in lepidopterans by the mid-Eocene.