Assessing the landscape ecological risk (LER) will facilitate optimal planning of land-use patterns and mitigating regional ecological risks, especially in megacities under rapid urbanization. And selecting the appropriate spatial analysis scales is the prerequisite for accurate assessment of the LER. In this study, we demonstrate the spatio-temporal dynamics of LER by determining the appropriate spatial scales in Beijing, China from 2000 to 2020. The results indicate that a granularity of 50 m and a magnitude of 5 km are optimal for regional LER assessment. The study area had predominantly medium risks, with medium, high and higher risks accounting for approximately 70% that revealed LER was at high level. Fortunately, the high and higher risks decreased by 14.64% while low and lower risks increased by 16.62% over the past two decades, which indicated LER was on a general downward trend. The LER pattern varies from east to west, with high and higher risks clustered in the northeast and southeast of the city center, and gradually dispersing elsewhere. In contrast, low and lower risks were predominantly in the city center and western regions, expanding outward from the city center. The LER was low in built-up land and cropland in the central city, but relatively high in areas away from it. The urban fringe areas dominated by woodland and grassland exhibited a high LER. The regional LER differentiation is spatially correlated with urban expressways and significant changes in LER were predominantly observed in areas adjacent to urban expressways. Specifically, the expansion of low and lower risks occurred outward along the ring roads of Beijing, and a typical case was that the lower risks were primarily enclosed by the fifth ring road in 2000 and gradually expanded towards the areas near the sixth ring road by 2020. Moreover, the LER manifests obvious spatial agglomeration influenced by human disturbance, with apparent high-high and low-low agglomerations. It is suggested to implement landscape optimization by enhancing the landscape diversity and connectivity to effectively mitigate ecological risks. These findings will provide scientific reference for researches aimed at mitigating ecological risks and fostering high-quality sustainable development in metropolitan areas.