ABSTRACT Mammalian sex is determined by opposing networks of ovarian and testicular genes that are well characterized. However, its epigenetic regulation is still largely unknown, thus limiting our understanding of a fundamental process for species propagation. Here we explore the 3D chromatin landscape of sex determination in vivo , by profiling FACS-sorted embryonic mouse gonadal populations, prior and after sex determination, in both sexes. We integrate Hi-C with ChIP-seq experiments using METALoci , a novel genome spatial auto-correlation analysis that identifies 3D enhancer hubs across the genome. We uncover a prominent rewiring of chromatin interactions during sex determination, affecting the enhancer hubs of hundreds of genes that display temporal- and sex-specific expression. Moreover, the identification of the 3D enhancer hubs allows the reconstruction of regulatory networks, revealing key transcription factors involved in sex determination. By combining predictive approaches and validations in transgenic mice we identify a novel Fgf9 regulatory hub, deletion of which results in male-to-female sex reversal with the upregulation of ovarian-specific markers and the initiation of meiosis. Thus, spatial auto-correlation analysis is an effective strategy to identify regulatory networks associated to biological processes and to further characterize the functional role of the 3D genome.