Over the past 40 years of reform and opening up, China has attracted a large number of foreign investment. However, because of China's weak intellectual property protection environment, it is difficult to protect the intellectual assets of transnational enterprises, which will affect their investment decisions to some extent. In order to optimize the intellectual property system and improve the intellectual property environment, national intellectual property demonstration city policy was proposed in 2012 to improve the institutional environment. To explore the impact of national intellectual property demonstration city policy on foreign capital inflow, we explore the relationship between national intellectual property demonstration city and foreign direct investment (FDI) using the multi‐period differences‐in‐differences (DID) method based on city panel data of China from 2003 to 2019. Results shows the following: (1) Compared with non‐demonstration cities, national intellectual property demonstration cities are profit to FDI promotion. If a city is rated as a national intellectual property demonstration city, local FDI will increase by 5% on average. After a series of robustness tests, the conclusion is still tenable. (2) We find that the national intellectual property demonstration city policy has obvious urban heterogeneity. The effect of national intellectual property demonstration city policy on the increase in FDI is more significant in central cities, western cities, and key cities. (3) The mechanism test shows that national intellectual property demonstration city policies have a positive effect on FDI through increasing the government's strategic expenditure on intellectual property, improving urban technology innovation capacity, optimizing human capital structure, and promoting the marketization of cities. Therefore, China should continue to implement the policy of national intellectual property demonstration city, especially increasing the number of national intellectual property demonstration city in key cities, central cities, and western cities. On the one hand, these findings can help government evaluate the attractiveness of demonstration cities for FDI. On the other hand, it also provides relevant policy enlightenment for the Chinese government to select appropriate demonstration cities and further refine and implement the national intellectual property demonstration city policies.