In this paper, we propose a two-country, two sector monetary union DSGE model with housing. One of the countries is calibrated to represent the Spanish economy while the other one is the rest of the European monetary union. First, we illustrate how looser credit conditions coming from the Euro area, together with increases in housing demand, lead to an increase in house prices and credit in Spain. Then, we analyze to what extent, macroprudential policies could have avoided the excess in credit that triggered the financial crisis in Spain. We find that a countercyclical loan-to-value rule that mainly responds to house prices would have mitigated the credit boom in Spain. These results can also be applied to other countries facing similar problems in the housing sector and thinking about implementing macroprudential policies.