High-quality urbanization and a healthy ecosystem are both the material basis for sustainable social development. However, the tie between terrestrial ecosystem health and urbanization is still unclear. Therefore, we assessed the spatial and temporal dynamics of urbanization and TEH at 368 cities in China from 2000 to 2020, then explored their spatial interaction and driving mechanisms by spatial autocorrelation analysis and structural equation modeling. The results showed: (1) China’s comprehensive urbanization index (UI) improved from 0.08 in 2000 to 0.10 in 2020, contributing by some national urban agglomerations such as Beijing-Tianjin-Hebei, Yangtze River Delta, and Pearl River Delta. (2) China’s terrestrial ecosystem health index (EHI) also increased from 0.6718 to 0.6788. Ecosystem vigor improved significantly, while ecosystem organization and resilience both decreased. (3) EHI and UI appeared to be locally spatially dependent, and path dependence was presented at municipal scales. (4) At the national scale, urbanization is positive related to EHI, which were enhanced by social, economic and topography factors. The dominant drivers on EHI varied among regions, and urbanization improved EHI in all regions except for the southwest. Our study demonstrated that urbanization would promote terrestrial ecosystem health by implementing high-quality development and ecological management simultaneously, providing theoretical support for urban sustainable development and ecological management.