We present a general equilibrium model of intermediation designed to capture some of the key features of the modern financial system. The model incorporates financial constraints and state-contingent contracts, and contains a clearly defined pecuniary externality associated with asset fire sales during periods of stress. If a sufficiently severe shock occurs during a credit expansion, this externality is capable of generating a systemic financial crisis that may be self-fulfilling. Our model suggests that financial innovation and greater macroeconomic stability may have made financial crises in developed countries less likely than in the past but potentially more severe.