Falling costs of coordination and communication have allowed firms in rich countries to fragment their production process and offshore an increasing share of the value chain to low-wage countries. Popular discussions about the aggregate impact of this phenomenon on rich countries have stressed either a (positive) productivity effect associated with increased gains from trade, or a (negative) terms of trade effect linked with the vanishing effect of distance on wages. This paper proposes a Ricardian model where both of these effects are present and analyzes the effects of increased fragmentation and offshoring in the short run and in the long run (when technology levels are endogenous). The short-run analysis shows that when fragmentation is suffi ciently high, further increases in fragmentation lead to a deterioration (improvement) in the real wage in the rich (poor) country. But the long-run analysis reveals that these effects may be reversed as countries adjust their research efforts in response to increased offshoring. In particular, the rich country always gains from increased fragmentation in the long run, whereas poor countries see their static gains partially eroded by a decline in their research efforts.