We use a unique panel dataset and a policy experiment as an instrument to estimate the impact of policy-induced migration cost reductions on rural-urban migration and the associated increase in labor earnings for migrant workers in China. Our estimation shows that the observed labor earnings gap between agriculture and non-agriculture is mainly due to large migration costs and a large underlying productivity difference between the two sectors. Sorting plays only a minor role in accounting for the observed sectoral earnings gap. We construct a general equilibrium household model with migration that not only is consistent with the reduced form results, but also illustrates the channel through which the policy experiment affects migration. We then estimate the general equilibrium model structurally and use the estimated model to quantify the effects of various policies on migration, the labor earnings gap, and aggregate productivity.