The Wei general Sima Wang led his troops to resist the invaders while his colleague Deng Ai led a separate force from Longyou (隴右; around present-day Lintao County, Gansu) to support him. When the Wei forces reached the Great Wall, Jiang Wei ordered his troops to retreat to Mangshui (芒水; southeast of present-day Zhouzhi County, Shaanxi) and set up a camp with its back facing a mountain. Sima Wang and Deng Ai ordered their troops to surround Jiang Wei's camp but refrain from attacking. When Jiang Wei led his men to taunt the Wei forces to attack them, Sima Wang and Deng Ai gave strict orders to their troops to ignore the enemy.