In this paper, we model earnings management as a consequence of the interaction among self-interested economic agents -- namely, the managers, the shareholders, and the regulators. In our model, a manager controls a stochastic production technology and makes periodic accounting reports about his or her performance; an owner chooses a compensation contract to induce desirable managerial inputs and reporting choices by the manager; and a regulatory body selects and enforces accounting standards to achieve certain social objectives. We show that various economic trade-offs give rise to endogenous earnings management. Specifically, the owner may reduce agency costs by designing a compensation contract that tolerates some earnings management because such a contract allocates the compensation risk more efficiently. The earnings-management activity produces accounting reports that deviate from those prescribed by accounting standards. Given such reports, the valuation of the firm may be nonlinear and s-shaped, thereby recognizing the manager's reporting incentives. We also explore policy implications, noting that (1) the regulator may find enforcing a zero-tolerance policy -- no earnings management allowed -- economically undesirable; and (2) when selecting the optimal accounting standard, valuation concerns may conflict with stewardship concerns. We conclude that earnings management is better understood in a strategic context that involves various economic trade-offs.