This study examines the effect of unionization on US firms’ accruals‐based earnings management and future employee compensation expenses by employing a research design that overcomes the inherent endogeneity issue of the relationship between unionization and earnings management. First, by comparing firms that just pass unionization by a small number of votes to those that just barely lose elections, the regression discontinuity design estimations document significant downward accruals earnings management for firms that barely pass unionization, compared to those that barely fail to pass unionization. Second, the association between unionization and earnings management is only significant in US states without right‐to‐work legislation, where unions are more powerful. These findings are consistent with recently unionized firms’ incentives to report lower earnings in order to mitigate unions’ demands for greater employee compensation. Further, for firms that barely pass unionization, we find that: (1) unions cannot fully “undo” the effects of earnings management, that is, downward managed earnings depress future compensation expenses, and (2) firms cannot fully “undo” the effects of unionization, that is, compensation expenses increase after unionization despite the downward earnings management.