Excretion is an essential physiological process, carried out by all living organisms regardless of their size or complexity(1–3). Most animals, which include both protostomes (e.g. flies, flatworms) and deuterostomes (e.g. humans, sea urchins) (together Nephrozoa(4, 5)), possess specialized excretory organs. Those organs exhibit an astonishing diversity, ranging from units composed of just three distinct cells (e.g. protonephridia) to complex structures, built by millions of cells of multiple types with divergent morphology and function (e.g. vertebrate kidneys)(6, 7). Although some molecular similarities between the development of kidneys of vertebrates and the regeneration of the protonephridia of flatworms have been reported(8, 9), the molecular development of nephrozoan excretory organs has never been systematically studied in a comparative context(6). Here we show that a set of highly conserved transcription factors and structural proteins is expressed during the development of excretory organs of six species that represent major protostome lineages and non-vertebrate deuterostomes. We demonstrate that the molecular similarity witnessed in the vertebrate kidney and flatworm protonephridia(8) is also seen in the developing excretory organs of other Nephrozoa. In addition, orthologous structural proteins forming the ultrafiltration apparatus are expressed in all these organs in the filter-forming cells. Our results strongly suggest that excretory organs are homologous and are patterned by the conserved set of developmental genes. We propose that the last common nephrozoan ancestor possessed an ultrafiltration-based, ciliated excretory organ, a structure that later gave rise to the vast diversity of extant excretory organs, including the human kidney.Significance statementMost of the bilaterally symmetrical animals excrete through specialized excretory organs, such as kidneys and nephridia. However, due to the morphological diversity of these organs, it remains unknown whether those structures evolved from a common ancestral organ or appeared several times independently during evolution. In order to answer the question about the origin of excretory organs we investigated the molecular pathways and structural genes involved in the development of nephridia in 6 animal species representing major evolutionary lineages. We show that diverse excretory organs share an ancient molecular patterning and structural molecules. Our results provide strong evidence that all excretory organs originated from a single, simple organ that performed urine production by ultrafiltration in deep geological past.