Nanog is a master pluripotency factor of embryonic stem cells (ESCs). Stable expression of Nanog is essential to maintain the stemness of ESCs. However, Nanog is a short-lived protein and quickly degraded by the ubiquitin-dependent proteasome system. Here we report that the deubiquitinase USP21 interacts with, deubiquitinates and stabilizes Nanog, and therefore maintains the protein level of Nanog in mouse ESCs (mESCs). Loss of USP21 results in Nanog degradation, mESCs differentiation and reduces somatic cell reprogramming efficiency. USP21 is a transcriptional target of the LIF/STAT3 pathway and is downregulated upon differentiation. Moreover, differentiation cues promote ERK-mediated phosphorylation and dissociation of USP21 from Nanog, thus leading to Nanog degradation. In addition, USP21 is recruited to gene promoters by Nanog to deubiquitinate histone H2A at K119 and thus facilitates Nanog-mediated gene expression. Together, our findings provide a regulatory mechanism by which extrinsic signals regulate mESC fate via deubiquitinating Nanog.