In this paper we analyse how the terms of trade (TOT) - the ratio of export prices to import prices - affect total factor productivity (TFP). We provide empirical macroeconomic evidence for the European Union countries based on the times series SVAR analysis and microeconomic evidence based on industry level data from the Competitiveness Research Network (CompNet) database which shows that the terms of trade improvements are associated with a slowdown in the total factor productivity growth. Next, we build a theoretical model which combines open economy framework with the endogenous growth theory. In the model the terms of trade improvements increase demand for labour employed in exportable goods production at the expense of technology production (research and development - R&D) which leads to a shift of resources from knowledge development towards physical exportable goods. This reallocation has a negative impact on the TFP growth. Under a plausible calibration the model is able to replicate the observed empirical pattern.