(1 The acceleration of urbanization and the frequent occurrence of natural disasters have led to increasingly fragmented habitats and decreased ecological connectivity, which in turn hinder rural sustainable development. Constructing ecological networks is a key direction in the spatial planning. By strengthening source protection, corridor construction, and ecological control, it can effectively alleviate the contradiction between regional ecological and economic development imbalance and promote biodiversity enhancement. With Yanqing District as an example, we constructed the ecological network by means of the morphological spatial pattern analysis, the connectivity analysis software, and the minimum cumulative resistance model. We analyzed various network elements from a county perspective, and provide suggestions for the development of towns. The results showed that the ecological network of Yanqing District as a whole presented the distribution characteristics of "the Mountain and the Plain". A total of 12 ecological sources were identified, covering an area of 1085.54 km², accounting for 54.4% of the total area. 66 ecological corridors were screened with a total length of 1057.18 km, including 21 important corridors and 45 general corridors, with the length of which accounting for 32.6% and 67.4%, respectively. 27 first-class ecological nodes and 86 second-class ecological nodes were identified, which were concentrated in "the Mountain" such as Qianjiadian and Zhenzhuquan. The distribution of ecological networks in different towns was closely related to their geographical environment and development orientation. The towns such as Qianjiadian and Zhenzhuquan were located in "the Mountain", covering a wide range of ecological sources and corridors. Strengthening protection of ecological source was the focus of network construction, which can promote the coordinated development of ecology and tourism in towns. The towns such as Liubinbao and Zhangshanying were located at the junction of "the Mountain- Plain", hence strengthening corridor connectivity was the main direction of network construction, which could promote the construction of ecological landscape in towns. The towns such as Yanqing and Kangzhuang were located in the " the Plain", with serious landscape fragmentation due to the lack of ecological sources and corridors. Those towns need to build green livable towns through increasing ecological nodes and strengthening ecological restoration. This study enriched the construction of ecological networks at the county scale, explored the interface with spatial planning, strengthened ecological restoration and ecological control, which had reference value for promoting the sustainable development of towns and the construction of a multi-scale ecological network. [ABSTRACT FROM AUTHOR]