We examine the effect of CEO gender on earnings management in the contrasting theoretical contexts of risk aversion and social identity. Using a sample of Chinese family firms, we demonstrate that firms with female CEOs display a higher level of earnings management than firms with male CEOs. These findings remain robust after using alternative measures for key variables and addressing endogeneity concerns. Furthermore, family identity and board gender diversity, which provide family support and female support to alleviate social bias against female CEOs, weaken the relationship between female CEOs and earnings management. Conversely, financial crisis, which exacerbates social bias, strengthens this relationship. From the perspective of economic consequence, earnings management increases the pay - performance sensitivity for female CEOs and reduces their termination risk. Overall, we provide evidence in support of social identity theory.