We analyze the effect of deposit insurance on the risk-taking behavior of banks in the context of a quasi-natural experiment using detailed credit registry data. Using the case of an emerging economy, Bolivia, which introduced a deposit insurance system during the sample period, we compare the risk-taking behavior of banks before and after the introduction of this system. We find that in the post-deposit insurance period, banks are more likely to initiate riskier loans (i.e., loans with worse internal ratings at origination). These loans carry higher interest rates and are associated with worse ex-post performance (i.e., they have higher default and delinquency rates). Banks do not seem to compensate for the extra risk by increasing collateral requirements or decreasing loan maturities. We also find evidence that the increase in risk-taking is due to the decrease in market discipline from large depositors. Finally, differences between large (too-big-to-fail) and small banks diminished in the post-deposit insurance period.