The extent to which a country can benefit from trade openness crucially depends on how easily it can reallocate resources. However, we know little about the role of domestic frictions in shaping the effects of trade policy. I address this question by analyzing the impact of tariff reductions on the spatial allocation of labor in China and how this impact depends on migration frictions that stem from China's household registration system (hukou). I first provide reduced-form evidence that input trade liberalization has induced significant spatial labor reallocation in China, with a stronger effect in regions with less hukou frictions. The quantitative exercise shows that trade liberalization increases China's welfare by 0.71%. Abolishing the hukou system leads to a direct welfare improvement of 1.33%. Additionally, it increases gains from tariff reductions by 2% and alleviates the latter's negative distributional consequences. I also develop a novel measure of migration frictions associated with the hukou system.