Oct4 exerts a dose-dependent dual action, as both a gatekeeper for stem cell pluripotency and in driving cells toward specific lineages. Here, we identify the molecular mechanism underlying this dual function. BMP2- or transgene-induced Oct4 up-regulation drives human embryonic and induced pluripotent stem cells to become cardiac progenitors. When embryonic stem cell pluripotency is achieved, Oct4 switches from the Sox2 to the Sox17 promoter. This switch allows the cells to turn off the pluripotency Oct4-Sox2 loop and to turn on the Sox17 promoter. This powerful process generates a subset of endoderm-expressing Sox17 and Hex, both regulators of paracrine signals for cardiogenesis (i.e., Wnt, BMP2) released into the medium surrounding colonies of embryonic stem cells. Our data thus reveal a novel molecular Oct4- and Sox17-mediated mechanism that disrupts the stem cell microenvironment favoring pluripotency to provide a novel paracrine endodermal environment in which cell lineage is determined and commits the cells to a cardiogenic fate.