Existing studies argue that armed conflict reduces foreign direct investment (FDI) or, following rational expectations theory, should not affect FDI. In this paper, I offer a new theory on how armed conflict affects FDI, which encompasses the interaction between political risk and market conditions and provides a systematic explanation for investors’ divergent responses including an opportunistic behavior. To do so, I present a formal model focusing on a commodity’s price, which is a key to investors’ profits and is also influenced by political risk. The model demonstrates that investors do not necessarily reduce FDI against political risk if armed conflict is expected to increase profit by increasing commodity prices, ceteris paribus. Statistical analysis of 50 countries that received FDI in the petroleum sector from 1980 to 2006 reveals that armed conflict (intrastate and interstate) reduces FDI in petroleum. However, it also shows that the effect of armed conflict on FDI in petroleum varies depending on oil prices. Consistent with the predictions, I find that investors do not decrease investment as oil prices get higher. An additional analysis on US FDI in petroleum from 1982 to 2006 also confirms the finding. This insight adds a new dimension to a current debate about the relationship between conflict and FDI.