Systemic risk arises when shocks lead to states where a disruption in financial intermediation adversely affects the economy and feeds back into further disrupting financial intermediation. We present a macroeconomic model with a financial intermediary sector subject to an equity capital constraint. The novel aspect of our analysis is that the model produces a stochastic steady state distribution for the economy, in which only some of the states correspond to systemic risk states. The model allows us to examine the transition from "normal" states to systemic risk states. We calibrate our model and use it to match the systemic risk apparent during the 2007/2008 financial crisis. We also use the model to compute the conditional probabilities of arriving at a systemic risk state, such as 2007/2008. Finally, we show how the model can be used to conduct a macroeconomic "stress test" linking a stress scenario to the probability of systemic risk states.