I develop a model of financial networks in which linkages not only spread contagion, but also induce private sector bailouts, where liquid banks bail out illiquid banks because of the threat of contagion. Introducing this bailout possibility, I show that linkages may be optimal ex ante because they allow banks to obtain some mutual insurance even though formal commitments are impossible. However, in some cases (e.g., when liquidity is concentrated among a small group of banks), the whole network may collapse. I also characterize the optimal network size and apply the results to joint liability arrangements and payment systems.