How to combine regional ecological risks and local ecological needs to construct ecological security is one of the main issues of its application in territorial spatial governance and associated with whether it can be effectively applied. Based on the "source" accessibility and the quality of space, we constructed the ecological security pattern of Xianyang City through the way of source-corridor-node. During the construction processes, we combined the cha-racteristics of topography, influencing factors of regional ecological security, and landscape characteristics. We coupled them with morphological spatial pattern analysis (MSPA) and comprehensive evaluation results of ecological resistance, ecological connectivity and ecosystem service value, and superimposed with ecological gradient ana-lysis. The results showed that there were 66 ecological sources, with a total area of 2506.65 km2, accounting for 24.6% of the total area of Xianyang City, which were mainly distributed in the northeast, west and central mountainous areas. There were 106 ecological corridors with a total length of 823.5 km, including potential corridors, water systems, irrigation canal sites, Qinzhidao and other natural and cultural systems, which extended along the ecological source to the northwest and south Weihe River. There were 20 ecological nodes to improve ecological connectivity, which were mainly distributed between second layers of loess tableland and arid mountainous areas with banded distribution in the north part of the city.