This paper studies a version of Obstfeld's (1997) "escape clause" model. The model is calibrated to produce three rational expectations equilibria. Two of these equilibria are E-stable in the sense of Evans (1985), and one is unstable. Dynamics are introduced by assuming that agents must learn about the government's decision rule. It is assumed they do this using a stochastic approximation algorithm. It turns out that as a certain parameter describing the sensitivity of beliefs to new information gets small, the algorithm converges weakly to a small noise diffusion process. The dynamics of exchange rate changes are then characterized using large deviation techniques from Freidlin and Wentzell (1998). These methods describe the sense in which the limiting distribution of exchange rate changes is approximated by a two-state Markov-switching process, where the two states correspond to the two E-stable equilibria of the algorithm's mean dynamics. The analysis relates the parameters of this process to assumptions about learning and the stochastic properties of the underlying shocks. ; The model is applied to the exchange rate histories of Argentina, Brazil, and Mexico. Although two-state Markov-switching models describe these countries' exchange rate histories quite well, they have little ex ante predictive power. Of more interest to this paper, however, is the finding that observed currency crises look a lot like the predicted 'escape routes' of the calibrated escape clause model, augmented with an adaptive learning rule. A key feature of these escape routes is that expectations of a devaluation erupt suddenly, without any large contemporaneous shocks. This is consistent with evidence showing that crises are often poorly anticipated by financial markets.