Over the past few decades, wealthy countries have relied increasingly on imports from developing countries, prompting concerns regarding the environmental impacts of trade. Some argue that increased exports from developing countries increase global emissions, as environmental regulation in the developing world tends to be relatively weak. But increased exports need not imply increased emissions if domestic sales are jointly determined with export sales or if emission intensity adjusts endogenously to foreign demand. In this paper, we estimate how production and emissions of manufacturing firms in a developing country respond to foreign demand shocks in trading partner markets. Using a panel of large Indian manufacturers and an instrumental variable strategy, we find that foreign demand growth leads to higher growth rates for exports, domestic sales, production, and CO 2 emissions, and to stronger reductions in emission intensity, both at the firm level and at the firm-product level. This represents the first empirical evidence of technological upgradings at the product level net of price effects. In terms of magnitudes, counterfactual computations reveal that the emission intensity reductions mitigate about half of the scale effect (from exports and domestic sales growth) on average.