Ma Su arrived at Jieting and, ignoring Wang Ping's advice, abandoned the flatlands and set up camp on a hilltop, saying, 'When placed in a death ground, one can survive! If Wei troops come, we will have the advantage of height.' Wang Ping strongly advised against it but was ignored, so he led his own troops to set up camp at the foot of the mountain to provide support.
Meanwhile, Wei generals Sima Yi and Zhang He led their troops to Jieting. Seeing Ma Su encamped on the hill, they cut off his water supply and surrounded the mountain tightly. The Shu troops on the mountain, without water, fell into chaos without even fighting. Sima Yi seized the opportunity to attack the hill. Ma Su was defeated, and Jieting fell. Wang Ping fought desperately to rescue the remaining troops.
When Kongming learned that Jieting had fallen, he was greatly alarmed and hastily ordered a retreat. After returning to Hanzhong, he convened a military meeting and intended to execute Ma Su. The generals pleaded for mercy, but Kongming said with tears, 'Military law is impartial!' Thus, Ma Su was executed. Ma Su did not complain at his execution, saying, 'I will seek to repay this debt in another life.' Kongming demoted himself to Right General while still acting as Chancellor. The first Northern Expedition came to a temporary halt.
Now, Zhuge Liang, in his Northern Expedition to conquer the Central Plains, knew that to take Chang'an, he must first capture Jieting. So he gathered his generals and asked, 'Jieting is our vital throat; the stakes are very high. If we lose this place, the main army will be in danger. Who can defend it?' All the generals remained silent. Ma Su stepped forward and said, 'I am willing to stake my entire family's lives to secure this critical position.' Liang said, 'Though Jieting is small, it has rugged mountain roads and is hard to defend for long. Sima Yi is no ordinary man; I fear you may not be up to the task.' Ma Su laughed and said, 'Does the Chancellor treat me like a child? I have studied military texts since childhood and know the art of war well; why should I fear them?' Liang said, 'The Art of War says, 'When occupying a height, one can smash the enemy like splitting bamboo.' But if the enemy cuts off your water and besieges the hill, what then?' Ma Su said, 'If they cut off our water, our troops can charge down from the hilltop and defeat ten times their number—why should I be afraid?' Liang repeatedly instructed, 'Set up camp on the main road to defend it. Do not camp on the mountain.' Ma Su still insisted and signed a military pledge, so Liang agreed and appointed Wang Ping as his deputy. Ma Su accepted the order with high spirits and departed.