Using panel data for the period 1970-97, I examine the relation between a developing country's trade openness and the stock of its FDI liabilities. The paper makes two contributions. First, I find that trade openness is positively correlated with FDI liabilities, with or without country fixed effects. Moreover, this correlation remains robust to the inclusion of additional variables on the right hand side, such as GDP per capita, inflation, institutional quality, macroeconomic volatility and measures of capital controls. Secondly, I show that the source of this correlation is causality from FDI to trade openness, rather than the other way around. To establish this, I run IV regressions first with FDI as the dependent variable, and trade liberalization dates instrumenting for trade openness, and then with trade openness as the dependent variable, and bilateral investment treaties signed by countries instrumenting for FDI. I find that trade liberalization increases trade openness, but predicted trade openness has no explanatory power for FDI liabilities. On the other hand, the number of bilateral investment treaties signed by a country significantly increases its stock of FDI liabilities, and the predicted stock of FDI liabilities has significant explanatory power for trade openness. This is an important finding because the standard approach so far in the literature has been to include trade openness on the right hand side of regressions (with the left hand side involving some measure of FDI liabilities), thereby implicitly assigning to it a causal role. My paper shows that this practice introduces endogeneity bias in the regression coefficients.