The flow of foreign direct investment into developing countries varies greatly across countries and over time. The political factors that affect these flows are not well understood. Focusing on the relationship between trade and investment, we argue that international trade agreements—GATT/WTO and preferential trade agreements (PTAs)—provide mechanisms for making commitments to foreign investors about the treatment of their assets, thus reassuring investors and increasing investment. These international commitments are more credible than domestic policy choices, because reneging on them is more costly. Statistical analyses for 122 developing countries from 1970 to 2000 support this argument. Developing countries that belong to the WTO and participate in more PTAs experience greater FDI inflows than otherwise, controlling for many factors including domestic policy preferences and taking into account possible endogeneity. Joining international trade agreements allows developing countries to attract more FDI and thus increase economic growth.