Fox genes are a large and conserved family of transcription factors involved in many key biological processes, including embryogenesis and body patterning. Although the role of Fox genes has been studied in an array of model systems, comprehensive comparative studies in Spiralia—a large clade of invertebrate animals including molluscs and annelids—are scarce but much needed to better understand the evolutionary history of this gene family. Here, we reconstruct and functionally characterise the Fox gene complement in the annelid Owenia fusiformis, a slow evolving species and member of the sister group to all remaining annelids. The genome of O. fusiformis contains at least a single ortholog of each of the 23 Fox gene classes that are ancestral to Bilateria, except for foxE and foxI. Temporal and spatial expression dynamics reveal a conserved role of Fox genes in gut formation (foxA), mesoderm patterning (foxF, foxL1, foxC, foxH) and cilia formation (foxJ1) in Annelida and Spiralia. Moreover, we uncover an ancestral expansion of foxQ2 genes in Spiralia, represented by 11 paralogs in O. fusiformis. Notably, although all foxQ2 copies have apical expression in O. fusiformis, they show variable spatial domains and staggered temporal activation, which suggest cooperation and sub-functionalisation among foxQ2 genes for the development of apical fates in this annelid. Altogether, our study informs the evolution and developmental roles of Fox genes in Annelida and Spiralia generally, providing the basis to explore how regulatory changes in Fox gene expression might have contributed to developmental and morphological diversification in Spiralia.Significance statementThe role of Fox genes, a group of DNA-binding proteins required for the formation of many animal organs, is poorly understood in invertebrate groups such as molluscs and annelids. Here, by studying the genome and embryogenesis of the annelid Owenia fusiformis, we demonstrate that Fox genes are involved in the development of the gut, muscles, cilia, and nervous system. Importantly, we find that a group of Fox genes (referred to as foxQ2) expressed in the anterior end of most animals has more copies in annelids and molluscs than in other invertebrate groups like insects and sea stars. Together, our findings clarify the evolution of Fox genes and their contribution to the diversity of forms and organs found in marine invertebrates.