In humans and most mammals, differentiation of the embryonic gonad into ovaries or testes is controlled by the Y-linked gene SRY. Here we show a role for the Gadd45g protein in this primary sex differentiation. We characterized mice deficient in Gadd45a, Gadd45b and Gadd45g, as well as double-knockout mice for Gadd45ab, Gadd45ag and Gadd45bg, and found a specific role for Gadd45g in male fertility and testis development. Gadd45g-deficient XY mice on a mixed 129/C57BL/6 background showed varying degrees of disorders of sexual development (DSD), ranging from male infertility to an intersex phenotype or complete gonadal dysgenesis (CGD). On a pure C57BL/6 (B6) background, all Gadd45g(-/-) XY mice were born as completely sex-reversed XY-females, whereas lack of Gadd45a and/or Gadd45b did not affect primary sex determination or testis development. Gadd45g expression was similar in female and male embryonic gonads, and peaked around the time of sex differentiation at 11.5 days post-coitum (dpc). The molecular cause of the sex reversal was the failure of Gadd45g(-/-) XY gonads to achieve the SRY expression threshold necessary for testes differentiation, resulting in ovary and Müllerian duct development. These results identify Gadd45g as a candidate gene for male infertility and 46,XY sex reversal in humans.