The actions of endogenous opioids and nociceptin/orphanin FQ are mediated by four homologous G protein-coupled receptors that constitute the opioid receptor family. However, little is known about opioid systems in cyclostomes (living jawless fish) and how opioid systems might have evolved from invertebrates. Here, we leveraged de novo transcriptome and low-coverage whole-genome assembly in the Pacific hagfish (Eptatretus stoutii) to identify and characterize the first full-length coding sequence for a functional opioid receptor in a cyclostome. Additionally, we define two novel endogenous opioid precursors in this species that predict several novel opioid peptides. Bioinformatic analysis shows no closely related opioid receptor genes in invertebrates with regard either to the genomic organization or to conserved opioid receptor-specific sequences that are common in all vertebrates. Furthermore, no proteins analogous to vertebrate opioid precursors could be identified by genomic searches despite previous claims of protein or RNA-derived sequences in several invertebrate species. The presence of an expressed orthologous receptor and opioid precursors in the Pacific hagfish confirms that a functional opioid system was likely present in the common ancestor of all extant vertebrates some 550 million years ago, earlier than all previous authenticated accounts. We discuss the premise that the cyclostome and vertebrate opioid systems evolved from invertebrate systems concerned with antimicrobial defense and speculate that the high concentrations of opioid precursors in tissues such as the testes, gut, and activated immune cells are key remnants of this evolutionary role.