We examine the effect of corruption on foreign direct investment (FDI). Starting out from the theory of FDI, we show that corruption can have different effects on horizontal investments, which are primarily aimed at sales to the local market, compared with vertical investments, which are made to access lower factor costs for export sales. Using Swedish firm-level data, we find that corruption reduces the probability that a firm will invest in a country. Moreover, when studying the different types of investments, we find that horizontal investments, measured by affiliate local sales, are deterred by corruption to a larger extent than are vertical investments. We are also able to establish a causal effect of corruption on FDI.