During early animal evolution, the emergence of axially-polarized segments was central to the diversification of complex bilaterian body plans. Nevertheless, precisely how and when segment polarity pathways arose remains obscure. Here we demonstrate the molecular basis for segment polarization in developing larvae of the pre-bilaterian sea anemone Nematostella vectensis. Utilizing spatial transcriptomics, we first constructed a 3-D gene expression atlas of developing larval segments. Capitalizing on accurate in silico predictions, we identified Lbx and Uncx, conserved homeodomain-containing genes that occupy opposing subsegmental domains under the control of both BMP signaling and the Hox-Gbx cascade. Functionally, Lbx mutagenesis eliminated all molecular evidence of segment polarization at larval stage and resulted in an aberrant mirror-symmetric pattern of retractor muscles in primary polyps. These results demonstrate the molecular basis for segment polarity in a pre-bilaterian animal, suggesting that polarized metameric structures were present in the Cnidaria-Bilateria common ancestor over 600 million years ago. Overall design: A total of 24 samples were analyzed to identify DEGs under different Hox mutant background. 3 mutant strains (Anthox1a, Anthox8 and Anthox6a) were collected at three different developmental time points (48hpf, 60hpf and 72hpf) with 2 replicates each. 2 replicates of wildtype animals that were spawned on the same date as mutants were collected in parallel as controls. A total of 6 samples were analyzed to identify DEGs after knocking down Pbx using shRNA. 2 independent shRNAs targeting Pbx were injected into wildtype oocytes. 1 scrambled control shRNA was injected into wildtype oocytes as control. 2 replicates per shRNA were collected at 72hpf. 1 single cell RNA-seq sample was analyzed to generate the Endo-atlas.