Larvae of Lepidoptera are mainly herbivores, and only the larval stages of Bradypodicola and Cryptoses pyralid moths are known to be specialized coprophages. Here, we report coprophagy as a main feeding habit for the larvae of another pyralid moth, Aglossa pinguinalis, on the basis of observational and experimental evidence. The larvae of this moth require two years to complete development, and construct silk tubes connecting the food source with a shelter chamber. Larvae of A. pinguinalis were mostly found inside caves, where they were about 700 times more abundant than in the open field. Inside the caves, observational results indicate that 98% of the larvae fed mostly on excrement and only 2% were recorded as eating other kinds of detritus (decayed mushrooms). No larvae were recorded eating plant detritus in the censuses nor in experimental detritus patches. The larvae did not show preferences for different types of excrement in the caves. Experimental dog and sheep excrement corroborated this result, showing that the abundance of larvae did not differ between these two excrement types over the entire study. We suggest that habitat selection of A. pinguinalis is ecologically similar to the trophic specialization of Bradypodicola and Cryptoses, in spite of the differences in natural history traits among these moths. Feeding on dry excrement inside caves, or in buried sloth dung, may reflect the constraints for Lepidoptera successfully to colonize excrement: in more exposed excrement, they cannot compete with other coprophagous specialists owing to the lack of parental care (e.g. resource relocation) and slow growth rates. We hypothesize that coprophagous Lepidoptera will be restricted to competition- and predation-free habitats and resources, feeding on excrement inside caves and animal burrows.