This paper examines firms' choice between serving a foreign market through exports or foreign direct investment (FDI). We begin by unveiling a new empirical regularity: using a unique dataset that allows us to study the dynamics of firms' export and FDI choices in individual destination markets, we show that the overwhelming majority of firms serve a foreign market via exports before establishing affiliates in that market. To explain this pattern, we develop a simple dynamic model of export and FDI choices, in which a firm can only discover its ability to earn profits in a foreign market once it starts serving it. We show that uncertainty can lead to a gradual internationalization process, whereby the firm tests the foreign market via exports, before engaging in FDI. Consistent with the model's predictions, we find that most firms start serving a foreign market through exports; in the first years following export entry, many firms drop out of the foreign market, others survive and expand as exporters, some establish foreign affiliates. We show that a firm's export experience in a foreign market increases its probability of FDI entry; this effect decreases over time and increases with foreign market uncertainty. Our analysis suggests that exports and FDI, although substitutes from a static perspective, may be complements over time, since the knowledge acquired through export experimentation can lead firms to start investing abroad.JEL classifications: F10, D21, F13.