Now, Ma Su arrived at Jieting and, disregarding Zhuge Liang's orders, abandoned the main road and stationed his troops on the hill. Deputy General Wang Ping earnestly advised him, saying: 'The Prime Minister repeatedly instructed before leaving that we should camp on the main road. Now you abandon the main road for the hilltop—if Wei troops surround us and cut off our water supply, what will happen?' Ma Su rebuked him, saying: 'I have thoroughly studied the art of war. From a commanding height, we can sweep down like a splitting bamboo! If they come to attack, it will be a perfect chance to catch them all in one net. You have the views of a woman—not worth consulting!' Despite repeated earnest protests, Wang Ping had no choice but to lead his own troops to set up camp ten li down the mountain to prepare for support.
Wei ruler Cao Rui, hearing that Shu troops were invading, reinstated Sima Yi as Grand Commander, leading 200,000 troops to defend. Yi predicted that Jieting was the strategic point and rushed there overnight. Seeing Ma Su abandoning the main road and camping on the hill, Yi laughed and said: 'Ma Su is ignorant—he is courting his own destruction!' He then ordered his troops to surround the hill and cut off the path for drawing water. The Shu troops had no water, and their morale fell into chaos. Sima Yi took advantage to attack the hill; Ma Su could not hold out and fled, abandoning his armor. Wang Ping, seeing the situation was hopeless, also led his troops away. Jieting was thus lost. When Zhuge Liang heard that Jieting had fallen, he was greatly alarmed and urgently ordered troops from various locations to retreat.
Now, Zhuge Liang learned that Jieting was lost, and that Wei Yan and Zhao Yun had also suffered setbacks; the main army was shaken. Liang hastily ordered Ma Zhong and Jiang Wei to dispatch various units to retreat first, while he himself led only 5,000 troops to transport grain in Xicheng County. Suddenly, it was reported that Sima Yi was leading 150,000 troops, only twenty li from Xicheng. At that time, the city had no other generals—only a group of civil officials and 2,500 soldiers. All the officials were greatly alarmed and wanted to abandon the city and flee. Liang said: 'Our army has already retreated. If we abandon the city and flee, it will arouse suspicion instead.' He then ordered the city gates to be flung wide open, with only twenty-odd soldiers at each gate disguised as commoners sweeping the streets. He also ordered the troops to lower their banners and silence their drums, and not to move rashly. Liang himself donned a crane-feather cloak, took two young attendants carrying a zither, ascended the city wall tower, sat by the railing, lit incense, and played the zither, the sound carrying far into the countryside.