This paper studies the changes in labor allocation across firms and industries in response to changes in technology (captured by the adoption of information and communication technologies, ICT) and import competition, due to increased exposure to trade competition from China. We use detailed matched worker-firm data from the Swedish manufacturing sector. We provide new evidence on the mobility of heterogeneous workers across firms and document increased assortative matching of workers in ICT intensive industries. However, the sorting patterns are not uniform across industries within this group. The adoption of ICT along with stronger Chinese import competition results in a significant skill upgrade within high-wage firms. In contrast, in the absence of strong pressures in import competition, sorting occurs at the low end of the worker-firm distribution, i.e. low-skill workers allocate to low-wage firms. Industries with low ICT intensity do not exhibit any of these sorting patterns. We rationalize our empirical findings through a labor market matching model which is able to explain the increased assortative matching in ICT intensive industries through an increase in the relative demand for qualified workers.