We build a multicountry dynamic general equilibrium model to study the economic effects of the 2004 enlargement of the European Union. In our model, trade is costly and households of different skills and nationalities face costly forward-looking migration decisions. We exploit the timing of migration policy changes to identify the changes in migration costs. We find that the changes in migration and trade policy resulted in aggregate welfare gains but with heterogeneous effects across skill groups. We study the interaction between trade and migration policies and highlight the importance of trade for quantifying the welfare and migration effects of labor market integration.