In this paper, we investigate the role of sanctions in the relationship between macroeconomic determinants and foreign direct investment inflows. We also investigate the moderating role of sanctions in FDI inflows into Iran. The empirical results reveal that macro determinants such as infrastructure, exchange rate, inflation rate, investment return, and governance have a long-run impact on FDI inflows in Iran. Our findings also show that GDP growth rate and trade openness have no significant effect on FDI. Our results indicate that sanctions do not have a significant moderating role in the relationship between macroeconomic factors and foreign direct investment. Surprisingly, international sanctions have a positive relationship with FDI inflows in Iran. Furthermore, sanction has a positive impact on the inflation rate and exchange rate in Iran. Finally, our findings show that sanctions have had a significant impact on Iran's economic growth in recent years due to increasing the severity level of sanctions.