Over the past three decades, China has experienced the largest volumes of urban growth worldwide accompanied by a continued increase in rural built-up areas mainly due to the Hukou system (mainland China’s household registration system, separating urban and rural residents) [1][2], with an average annual increase of 3.23% in urban and 2.73% in rural built-up areas. Since China is much rich in biodiversity and has numerous species under threat, both urban and rural built-up land expansion may exacerbate the threats. Risks to biodiversity caused by urban-rural expansion, are crucial for human development and environmental sustainability, but less well explored. Here we investigate what extent urban and rural built-up land expansion contributed to habitat losses of endangered species. We estimate that from 1990 to 2020, urban and rural built-up land expansion induced 2% and 5% of habitat losses on average for each endangered species, and threatened 70% and 82% of endangered species, respectively. Rural built-up land expansion induced more losses of habitats with higher endangered species richness compared with urban expansion. The high-threat habitat areas caused by rural built-up land expansion were 2.5 times as large as those of urban expansion, and about 82% of endangered species were mainly threatened by rural built-up land expansion. Most of them were concentrated in central and south China, one of 25 biodiversity hot spots worldwide. Abolishment of the Hukou system accompanied by more policy arrangements for sustainable development can mitigate urban-rural inequalities. In this scenario, an average of about 647 km2/year would be released from fulfilling the need of built-up area, thus remaining as habitat for biodiversity. Our findings help to provide important insights for biodiversity preservation in the countries with urbanization or rural built-up land expansion, and inform local policy makers in their assessment of prioritization of future ecological sustainability.