This paper analyzes, empirically and theoretically, the link between capital inflows and the quality of economic institutions. Starting with the example of Southern European countries (Spain, Portugal, Italy and Greece), we show that they experienced a significant decline in the quality of their institutions in the run-up to the euro currency, a period of cheap external funding and large capital inflows. We confirm this joint pattern of capital flows and institutional decline in a large panel of countries since the mid-1990s. We then develop an open-economy model of the "soft budget constraint" syndrome wherein persistently cheap funding from abroad (i) raises the prevalence of extractive projects and (ii) expands their support by the (benevolent) government ex post. While the government may in principle limit the prevalence of extractive projects ex ante, we show that the incentives to do so is limited when foreign borrowing is cheap.