This paper examines how trade liberalization affects the innovation incentives of firms, and what this implies for industry productivity and social welfare. For this purpose we develop a reciprocal dumping model of international trade with heterogeneous firms and endogenous R&D. We identify two effects of trade liberalization on productivity: a direct effect through changes in R&D investment, and a selection effect due to inefficient firms leaving the market. We show how these effects operate in the short run when market structure is fixed, and in the long run when market structure is endogenous. Among the robust results that hold for any market structure are that trade liberalization (i) increases (decreases) aggregate R&D for low (high) trade costs; (ii) increases expected industry productivity; and (iii) raises expected social welfare if trade costs are low.