Endophytic feeding behaviors, including stem borings and galling, have been observed in the fossil record from as early as the Devonian and involve the consumption of a variety of plant (and fungal) tissues. Historically, the exploitation of internal stem tissues through galling has been well documented as emerging during the Pennsylvanian (c. 323-299 million years ago (Ma)), replaced during the Permian by galling of foliar tissues. However, leaf mining, a foliar endophytic behavior that today is exhibited exclusively by members of the four hyperdiverse holometabolous insect orders, has been more sparsely documented, with confirmed examples dating back only to the Early Triassic (c. 252-250 Ma). Here, we describe a trace fossil on seed-fern foliage from the Rhode Island Formation of Massachusetts, USA, representing the earliest indication of a general, endophytic type of feeding damage and dating from the Middle Pennsylvanian (c. 312 Ma). Although lacking the full features of Mesozoic leaf mines, this specimen provides evidence of how endophytic mining behavior may have originated. It sheds light on the evolutionary transition to true foliar endophagy, contributes to our understanding of the behaviors of early holometabolous insects, and enhances our knowledge of macroevolutionary patterns of plant-insect interactions.