IntroductionInvestigation of the evolutionary trend of habitat quality in karst and rocky desertification zones is crucial for enhancing ecological security and conservation.MethodsAnalysis of land use statistics from the years 2000, 2010, and 2020, changes in habitat quality (HQ) and land use (LULC) between 2000 and 2020 were analyzed using Huize County in Yunnan Province as an example. The InVEST and FLUS models were applied to simulate LULC under different scenarios in 2030 and 2040 and assess changes in spatial gradients of habitat quality at each timepoint and factors influencing them.ResultsThe findings indicated that (1) The predominant land use types are grassland and woodland, experiencing the most significant growth in urbanized areas, the main sources of which are paddy fields and high-cover grassland. (2) The habitat quality between 2000 and 2020 was average and displayed a consistent decline. The spatial distribution pattern indicates low HQ in urban areas, high HQ in the outskirts, low HQ in the south-west, and high HQ in the north-east. In all four scenarios, habitat quality predominantly decreases in urban areas and regions with a dense concentration of built-up land. (3) Habitat quality spatial distribution is primarily affected by the type of land use, with NDVI being the secondary determinant.DiscussionThe ecological environment of Huize County must be restored and safeguarded with a focus on ecological priorities and harmonious development scenarios. This study provides methodological lessons for ecorestoration and policymakers in areas of karstic rocky desertification.