This study explores how foreign competition impacts the capital structure of domestic firms. While existing literature reveals that import competition is associated with a decrease in domestic firms' leverage, we propose a novel perspective concerning the positive effect of inward foreign direct investment (FDI) on leverage. FDI competition can boost demand for debt via productivity spillover to domestic firms, and also increase supply of debt by inducing lenders to herd toward foreign investors. Using Chinese firm-level data, we find that the positive effects of industry inward FDI on domestic firms' leverage are more pronounced in high-tech industries, industries with higher productivity growth, and industries where foreign investors exhibit a higher degree of herding behavior. Our instrument variable approach, employing industry exchange rates and import tariffs, supports these findings. Additionally, we reveal that the positive effect of FDI on local firms' leverage is amplified when the firms have stronger absorptive capacities, receive foreign capital, and experience more human capital transfers from foreign rivals.