In this paper, we rely on an exogenous shock to examine the impact of litigation risk on real earnings management (REM). We conduct difference-in-differences tests centered on an unanticipated court ruling that reduced litigation risk for firms headquartered in the Ninth Circuit. REM increases significantly following the ruling for Ninth Circuit firms relative to other firms, consistent with litigation risk deterring REM. Additional analyses reveal that REM rises more following the ruling when firms issue more optimistic disclosures. The evidence is consistent with litigation deterring REM by constraining managers' ability to issue optimistic and misleading disclosures that can conceal the myopic and opportunistic motives underlying REM. We further document that an increase in REM in response to a decline in litigation risk is more pronounced when managers have higher incentives to manipulate earnings and governance mechanisms are weaker.