Specification of the germ cell lineage is vital to development and heredity. In mice, the germ cell fate is induced in pluripotent epiblast cells by signaling molecules, yet the underlying mechanism remains unknown. Here we demonstrate that germ cell fate in the epiblast is a direct consequence of Bmp4 signaling from the extraembryonic ectoderm (ExE), which is antagonized by the anterior visceral endoderm (AVE). Strikingly, Bmp8b from the ExE restricts AVE development, thereby contributing to Bmp4 signaling. Furthermore, Wnt3 in the epiblast ensures its responsiveness to Bmp4. Serum-free, defined cultures revealed that, in response to Bmp4, competent epiblast cells uniformly expressed key transcriptional regulators Blimp1 and Prdm14 and acquired germ-cell properties, including genome-wide epigenetic reprogramming, in an orderly fashion. Notably, the induced cells contributed to both spermatogenesis and fertility of offspring. By identifying a signaling principle in germ cell specification, our study establishes a robust strategy for reconstituting the mammalian germ cell lineage in vitro.