Pigment-dispersing factor (PDF) denotes a conserved family of homologous neuropeptides present in several invertebrate groups, including mollusks, nematodes, insects, and crustaceans (referred to here as pigment-dispersing hormone [PDH]). With regard to their encoding genes (pdf, pdh), insects possess only one, nematodes two, and decapod crustaceans up to three, but their phylogenetic relationship is unknown. To shed light on the origin and diversification of pdf/pdh homologs in Panarthropoda (Onychophora + Tardigrada + Arthropoda) and other molting animals (Ecdysozoa), we analyzed the transcriptomes of five distantly related onychophorans and a representative tardigrade and searched for putative pdf homologs in publically available genomes of other protostomes. This revealed only one pdf homolog in several mollusk and annelid species; two in Onychophora, Priapulida, and Nematoda; and three in Tardigrada. Phylogenetic analyses suggest that the last common ancestor of Panarthropoda possessed two pdf homologs, one of which was lost in the arthropod or arthropod/tardigrade lineage, followed by subsequent duplications of the remaining homolog in some taxa. Immunolocalization of PDF-like peptides in six onychophoran species, by using a broadly reactive antibody that recognizes PDF/PDH peptides in numerous species, revealed an elaborate system of neurons and fibers in their central and peripheral nervous systems. Large varicose projections in the heart suggest that the PDF neuropeptides functioned as both circulating hormones and locally released transmitters in the last common ancestor of Onychophora and Arthropoda. The lack of PDF-like-immunoreactive somata associated with the onychophoran optic ganglion conforms to the hypothesis that onychophoran eyes are homologous to the arthropod median ocelli.