In the last decade, there has been an increase in national insecurity in the country, which has resulted in many people being killed, kidnapped, and misplaced. Despite different measures put in place by the government, national security has not been well noticed in Nigeria. As a result, this study empirically examined the effect of national security on inflows of foreign direct investment in Nigeria, covering the period 2005–2021. The study measured foreign direct investment using the net inflow of foreign direct investment, while measuring national security by the budgets of external defence and internal security. Control variables are gross domestic product and trade openness. Secondary data were sourced from the CBN Statistical Bulletin and estimated using an auto-regressive distributed model. The study found that both government expenditure for external defence and internal defence had positive effects on foreign direct investment, while only government expenditure for external defence was found to significantly impact foreign direct investment in the long run at a 5% level of significance. This implies that continuous expenditure by the government to combat national insecurity would ensure a serene environment, which would assure the citizenry's desire for national security. The study concluded that national security has a significant effect on foreign direct investment in Nigeria. The study recommends that the government ensure that the expenditure on both external and internal defence is well utilised and directed to the necessary quarters to reduce insecurity, which would increase the influx of foreign direct investors in the country. Furthermore, the government should also ensure that the armed forces and paramilitary squads are well motivated to increase their morale to fight insecurity so as to ensure national security and peace of mind for all the people within the country.