I jointly study the optimal bailout policy and monetary policy in open economies that borrow in foreign currency from international lenders. A policy dilemma emerges during financial crises. Policymakers trade off the benefit of more bailouts alleviating firms’ financial constraints against the cost of larger currency devaluation, which tightens firms’ financial constraints. I embed the optimal bailout in an otherwise standard “sudden stop” model with nominal rigidities. The model sheds light on the role of bailouts and currency mismatch in driving the exchange rate dynamics, firms’ balance sheets and economic recovery. Quantitatively, the model matches key business cycle moments. A welfare evaluation shows that there are in general welfare gains from the systemic bailout policy despite ex ante moral hazard problems of firms.