We propose a parsimonious model of leverage and investment dynamics featuring a diffusion-jump cash-flow process, retained earnings, short-term debt, and external equity. Crucially equity issuance is costly. We show that firms' efforts to avoid incurring equity issuance costs generate empirically plausible target leverage and nonlinear leverage dynamics. Paradoxically, it is the high cost of equity issuance that causes the firm to keep leverage low, in contrast to the predictions of Modigliani-Miller and Leland tradeoff and Myers' pecking-order theories. The marginal source of external financing on an on-going basis is debt, but when leverage gets too high, the firm optimally deleverages by issuing equity at a cost. When leverage is low, it tends to revert to the target, but when leverage is high, the firm is caught in a debt death spiral. When the firm is at its target leverage, profits are paid out, but losses cause leverage to drift up. When leverage is high and the firm is hit by a large jump loss, it defaults.