We analyze the impact on productivity in advanced economies of fast-growing trade with China between the mid-1990s and late-2000s, separately identifying the export and import channels. We use country-sector-level data for 18 advanced economies and, similar to Autor, Dorn, and Hanson (2013), exploit exogenous variation in trade with China in a given country-sector by instrumenting imports from (exports to) China in a given country-sector with the average imports from (exports to) China in the same sector in other advanced economies. Our estimates point to large productivity gains from trading with China-the (exogenous) rise of China in global trade may have increased the level of total factor productivity by about 1.9 percent, or 12.3 percent of the overall increase over the sample period, in the median country-sector. By contrast, using a similar empirical strategy, we find adverse employment effects of Chinese imports in exposed country-industries, consistent with previous studies. Taken together, these findings point to large gains from free trade, while underscoring the scope for a more active policy role in redistributing them, particularly by easing workers' transition between jobs and industries.