We study a simple general equilibrium model in which investment in a risky technology is subject to moral hazard and banks can extract market power rents. We show that more bank competition results in lower economy-wide risk, lower bank capital ratios, more efficient production plans and Pareto-ranked real allocations. Perfect competition supports a second best allocation and optimal levels of bank risk and capitalization. These results are at variance with those obtained by a large literature that has studied a similar environment in partial equilibrium. Importantly, they are empirically relevant, and demonstrate the need of general equilibrium modeling to design financial policies aimed at attaining socially optimal levels of systemic risk in the economy.