Photoautotrophs are generally considered to be the base of food webs, and habitats that lack light, such as caves, frequently rely on surface-derived carbon. Here we show, based on analysis of gut contents and stable isotope ratios of tissues (13C:12C and 15N:14N), that sulfur-oxidizing bacteria are directly consumed and assimilated by the fish Poecilia mexicana in a sulfide-rich cave stream in Tabasco state, Mexico. Our results provide evidence of a vertebrate deriving most of its organic carbon and nitrogen from in situ chemoautotrophic production, and reveals the importance of alternative energy production sources supporting animals in extreme environments.