We study the joint dynamics of foreign capital flows and real activity during the recent boom-bust cycle of the Spanish economy, using a three-country New Keynesian model with credit-constrained households and firms, a construction sector and a government. We estimate the model using...