The vertebrate eye was described by Charles Darwin as one of the greatest potential challenges to a theory of natural selection by stepwise evolutionary processes. While numerous evolutionary transitions that led to the vertebrate eye have been explained, some aspects appear to be vertebrate specific with no obvious metazoan precursor. One critical difference between vertebrate and invertebrate vision hinges on interphotoreceptor retinoid-binding protein (IRBP, also known as retinol-binding protein, RBP3), which enables the physical separation and specialization of cells in the vertebrate visual cycle by promoting retinoid shuttling between cell types. While IRBP has been functionally described, its evolutionary origin has remained elusive. Here, we show that IRBP arose via acquisition of novel genetic material from bacteria by interdomain horizontal gene transfer(iHGT). We demonstrate that a gene encoding a bacterial peptidase was acquired prior to the radiation of extant vertebrates >500 Mya and underwent subsequent domain duplication and neofunctionalization to give rise to vertebrate IRBP. Our phylogenomic analyses on >900 high-quality genomes across the tree of life provided the resolution to distinguish contamination in genome assemblies from true instances of horizontal acquisition of IRBP and led us to discover additional independent transfers of the same bacterial peptidase gene family into distinct eukaryotic lineages. Importantly, this work illustrates the evolutionary basis of a key transition that led to the vertebrate visual cycle and highlights the striking impact that acquisition of bacterial genes has had on vertebrate evolution.