When faced with tougher import competition, firms can improve the productivity of their existing products (intensive margin) or reallocate their output towards more efficiently produced products (extensive margin). What is the contribution of each channel to aggregate productivity growth? To answer this question, I use a rich firm-product-level panel of Indian manufacturers between 1994 and 2008 to estimate product-specific productivity over time. The surge of Chinese exports to India allows me to estimate the causal effect of trade on both margins of productivity growth. I reach two main conclusions. First, greater Chinese import competition increased the productivity of existing products. Second, there was no causal effect on reallocation across products. My results suggest the intensive margin response to rising import competition accounts for 20-30 percent of the overall productivity growth in the manufacturing sector. These productivity gains have important policy implications because moving from low- to middle-income requires rising productivity, and my results provide evidence that greater import competition accelerates that process.