This paper analyzes the effects of countercyclical capital buffers (CCyB) in a nonlinear DSGE model with a financial sector that is subject to occasional panics. The model is combined with data to estimate sequences of structural shocks and study policy counterfactuals. First, I show that lowering capital buffers during a crisis can moderate the intensity of the crisis. Second, I show that raising capital buffers during leverage expansions can reduce the frequency of crises by more than half. A quantitative application to the 2008 financial crisis shows that CCyB in the ±2% range (as in the Federal Reserve’s current framework) could have greatly mitigated the financial panic in 2007Q4-2008Q4. These findings suggest that CCyB are a useful policy tool both ex-ante and ex-post.