To study the effects of land use pattern change on habitat quality in the background of urbanization, InVEST model was applied to calculate the contributions of habitat threats (urban area, rural construction area, main roads and agriculture land) to habitat degradation, and to assess habitat quality changes between 1990 and 2010 in Beijing. The results showed that the most severe habitat degradation problems occurred in Haidian, Chaoyang, Shijingshan and Fengtai districts, Yongding River, Chaobai River, and the mountain-plain border area (at an elevation about 75-100 m). Agriculture lands had the largest effect on habitat degradation, followed by urban areas, rural construction areas and main roads. During these two decades, the contribution of agriculture lands decreased from 77.79% to 61.15%, but the contribution of urban areas increased from 18.10% to 31.54%. Between 1990 and 2000, habitat quality declined dramatically in Haidian, Chaoyang, Shijingshan and Fengtai districts, which were located at the rim of Dongcheng and Xicheng districts. The total habitat quality value decreased by 2.3%. During 2000 and 2010, the deterioration of habitat quality expanded to most of the plain areas. In the mountain area of Fangshan and the mountain-plain border area (at an elevation about 75-100 m) in Miyun, Huairou, Changping and Fangshan, the value decreased significantly. However, habitat quality had been restored notably in northern and western mountain areas. The total habitat quality value declined by 1.2%, which indicated that habitat deterioration had been mitigated to some extent compared with the last decade. For habitat conservation and urban planning in the future, more attention should be paid to mountain-plain border areas. The current study played an active role in land use policy-making and biodiversity conservation.