Stem cells self-renew or differentiate under the governance of a stem-cell-specific transcriptional program, with each transcription factor orchestrating the activities of a particular set of genes. Here we demonstrate that a single transcription factor is able to regulate distinct core circuitries in two different blastocyst-derived stem cell lines, embryonic stem cells (ESCs) and extraembryonic endoderm (XEN) cells. The transcription factor Sall4 is required for early embryonic development and for ESC pluripotency. Sall4 is also expressed in XEN cells, and depletion of Sall4 disrupts self-renewal and induces differentiation. Genome-wide analysis reveals that Sall4 is regulating different gene sets in ESCs and XEN cells, and depletion of Sall4 targets in the respective cell types induces differentiation. With Oct4, Sox2, and Nanog, Sall4 forms a crucial interconnected autoregulatory network in ESCs. In XEN cells, Sall4 regulates the key XEN lineage-associated genes Gata4, Gata6, Sox7, and Sox17. Our findings demonstrate how Sall4 functions as an essential stemness factor for two different stem cell lines.