The assessment of the spatiotemporal evolution of habitat quality caused by land use changes can provide a scientific basis for the ecological protection and green development of mining cities. Taking Yanshan County as an example of a typical mining city, this article discussed the spatial pattern and evolution characteristics of habitat quality in 2000 and 2018 based on the ArcGIS platform and the InVEST model. The conclusions are as below: from 2000 to 2018, the area of farmland and construction land changed the most in the study area. Among them, the area of farmland decreased by 3.48%, and the area of industrial and mining land and construction land increased by 53.25%. Areas of low, relatively low and high habitat quality expanded, and areas of medium and relatively high habitat quality shrank, which is closely related to the distribution of land use. The areas with high habitat degradation degrees appear around cities, mining areas and watersheds, while the areas with low habitat degradation degrees are mainly distributed in the southern woodland. The distribution of cold and hot spots in the habitat quality distribution of Yanshan County presents a pattern of “hot in the south and cold in the north”. The results are of great significance to the precise implementation of ecosystem management decisions in mining cities and the creation of a landscape pattern of “beautiful countrysides, green cities, and green mines”.