Nemerteans (ribbon worms) and phoronids (horseshoe worms) are closely related lophotrochozoans-a group of animals including leeches, snails and other invertebrates. Lophotrochozoans represent a superphylum that is crucial to our understanding of bilaterian evolution. However, given the inconsistency of molecular and morphological data for these groups, their origins have been unclear. Here, we present draft genomes of the nemertean Notospermus geniculatus and the phoronid Phoronis australis, together with transcriptomes along the adult bodies. Our genome-based phylogenetic analyses place Nemertea sister to the group containing Phoronida and Brachiopoda. We show that lophotrochozoans share many gene families with deuterostomes, suggesting that these two groups retain a core bilaterian gene repertoire that ecdysozoans (for example, flies and nematodes) and platyzoans (for example, flatworms and rotifers) do not. Comparative transcriptomics demonstrates that lophophores of phoronids and brachiopods are similar not only morphologically, but also at the molecular level. Despite dissimilar head structures, lophophores express vertebrate head and neuronal marker genes. This finding suggests a common origin of bilaterian head patterning, although different heads evolved independently in each lineage. Furthermore, we observe lineage-specific expansions of innate immunity and toxin-related genes. Together, our study reveals a dual nature of lophotrochozoans, where conserved and lineage-specific features shape their evolution.