This paper analyzes to what extent labor market frictions limit the gains from market integration. I use an external demand shock to the Spanish economy as a natural experiment to identify and quantify the effect of labor mobility costs on Spain's development. Using newly digitized trade and labor market data, I show that during WWI (1914-1918) a large, temporary and sectorally heterogeneous demand shock emanated from belligerent countries, as a result of which Spain expanded its manufacturing employment and exports, while income growth between the north and south in Spain diverged. To quantify and analyse the role of mobility costs I build and estimate a multi-sector economic geography model that allows for sectoral and spatial mobility costs. Spatial mobility costs dominated with an estimated 80% of reallocation of labor taking place within rather than between provinces. I use the estimated model to calculate counterfactuals to examine the effects of and interaction between output and input market integration: Comparing to the non-shock counterfactual I find that the WWI-shock increased manufacturing employment by 10%, and induced highly uneven spatial development with the north growing 27% faster. The shock constituted a 6% increase in market size and increased aggregate real incomes by 20%. Lowering mobility costs by 10% increases real income gains from the WWI-shock by an additional 3%, and exceeds gains in the non-shock scenario, suggesting that labor market integration and output market integration are complements.