Land space underpins an ecological civilization. A thorough grasp of regional natural resources and subsequent optimization of the ecological security pattern are both essential for the comprehensive development and overall planning of the management of natural resources. In this study, we established and optimized the ecological security pattern in Shaanxi Province, China. Landscape patches distinguished by high importance of ecosystem services (carbon fixation and oxygen release, water conservation, habitat maintenance, and soil conservation) and high sensitivity of ecological environment to human interference (ecological sensitivity index) were extracted as ecological sources. An ecological resistance surface was built based on the following resistance factors: land-use type, topographic position index, and soil erosion intensity. A minimum cumulative resistance model was used to identify ecological corridors. Our results showed that those ecological sources with high to extreme ecological importance and sensitivity together covered an area of 67,457 km2 (32.8% of the total land area of Shaanxi Province). A total of 32 ecological nodes were identified at the center of important ecological sources to serve as main areas for implementing ecological protection projects. In addition, 72 ecological corridors were identified, towards which efforts should be targeted to maintain their functions for the inter-connection and serial connection of ecological nodes and source patches. The ecological corridors create favorable habitats for wildlife and superior spaces for ecological migration based on the blue and green linear corridor system. According to these findings, we propose establishing an ecological security pattern featuring “two barriers, three belts, and multiple corridors” in Shaanxi Province and that the green ecological security barriers should be strengthened based on their natural background and resource endowments.