Strong local investment capability is an important source for sustaining urban resilience, while outward foreign direct investment (OFDI) is the overseas transfer of local investment. Has OFDI mitigated the resilience of Chinese cities? Using the panel data of 272 prefecture level cities in China from 2008 to 2021, this research quantitatively measured urban resilience and studied the impact and mechanisms of OFDI and its extensive margin and intensive margin (dual margins) on urban resilience. The results showed that: (1) OFDI and its dual margins significantly enhanced urban resilience, and the extensive margin played a greater role in promoting urban resilience. (2) From the perspective of urban scale, the role of OFDI in enhancing the resilience of large cities was stronger than that of small and medium sized cities, and large cities as well as small and medium sized cities had comparative advantages in enhancing urban resilience at the intensive and extensive margins of OFDI, respectively. (3) In terms of regions, OFDI and its dual margins in the eastern and central/western regions significantly improved urban resilience, and OFDI in the eastern and central/western regions had comparative advantages in improving urban resilience in terms of extensive margin and intensive margin, respectively. (4) In the period of shock resistance, the intensive margin of OFDI had a relatively large role in promoting urban resilience, and in the period of recovery and adjustment, OFDI and its extensive margin had a relatively large role in promoting urban resilience. (5) From the perspective of the action path, OFDI enhanced urban resilience by enhancing local technological innovation capability, improving local industrial structure, and promoting the integration of local industrialization and urbanization (industry city integration), and the mediating effect of industry-city integration was more prominent. This means that: (1) Government work in the eastern and western regions and large cities should focus on cultivating leading industrial enterprises and providing targeted public services, while that in the central region and small and medium sized cities should aim at reducing outward investment barriers and providing basic public services, with each other developing in a staggered manner. (2) During the shock resistance period and even during the pre shock resistance period, governments at all levels should take precautions, issuing warnings to leading industrial enterprises, and providing targeted assistance in hedging against shocks. The focus should be put on working with host countries through various bilateral agreements and investment arrangements to wade through difficulties, while during the recovery and adjustment period, governments at all levels should focus on further improving their own institutional constructions, improving the local business environment, and relieving enterprises of their worries to motivate more enterprises to engage in foreign investment. [ABSTRACT FROM AUTHOR]