The loss of the tail is one of the main anatomical evolutionary changes to have occurred along the lineage leading to humans and to the “anthropomorphous apes”1,2. This morphological reprogramming in the ancestral hominoids has been long considered to have accommodated a characteristic style of locomotion and contributed to the evolution of bipedalism in humans3–5. Yet, the precise genetic mechanism that facilitated tail-loss evolution in hominoids remains unknown. Primate genome sequencing projects have made possible the identification of causal links between genotypic and phenotypic changes6–8, and enable the search for hominoid-specific genetic elements controlling tail development9. Here, we present evidence that tail-loss evolution was mediated by the insertion of an individual Alu element into the genome of the hominoid ancestor. We demonstrate that this Alu element – inserted into an intron of the TBXT gene (also called T or Brachyury10–12) – pairs with a neighboring ancestral Alu element encoded in the reverse genomic orientation and leads to a hominoid-specific alternative splicing event. To study the effect of this splicing event, we generated a mouse model that mimics the expression of human TBXT products by expressing both full-length and exon-skipped isoforms of the mouse TBXT ortholog. We found that mice with this genotype exhibit the complete absence of a tail or a shortened tail, supporting the notion that the exon-skipped transcript is sufficient to induce a tail-loss phenotype, albeit with incomplete penetrance. We further noted that mice homozygous for the exon-skipped isoforms exhibited embryonic spinal cord malformations, resembling a neural tube defect condition, which affects ~1/1000 human neonates13. We propose that selection for the loss of the tail along the hominoid lineage was associated with an adaptive cost of potential neural tube defects and that this ancient evolutionary trade-off may thus continue to affect human health today.