Some time afterward, King Nahash of the Ammonites died, and his son succeeded him.
David said, "I will deal loyally with Hanun son of Nahash, for his father dealt loyally with me." So David sent messengers to console him concerning his father. When David's servants came to Hanun in the land of the Ammonites, to console him,
the officials of the Ammonites said to Hanun, "Do you think, because David has sent consolers to you, that he is honoring your father? Have not his servants come to you to search and to overthrow and to spy out the land?"
So Hanun seized David's servants, shaved them, cut off their garments in the middle at their hips, and sent them away;
and they departed. When David was told about the men, he sent messengers to them, for they felt greatly humiliated. The king said, "Remain at Jericho until your beards have grown, and then return."
When the Ammonites saw that they had made themselves odious to David, Hanun and the Ammonites sent a thousand talents of silver to hire chariots and cavalry from Mesopotamia, from Aram-maacah and from Zobah.
They hired thirty-two thousand chariots and the king of Maacah with his army, who came and camped before Medeba. And the Ammonites were mustered from their cities and came to battle.
When David heard of it, he sent Joab and all the army of the warriors.
The Ammonites came out and drew up in battle array at the entrance of the city, and the kings who had come were by themselves in the open country.
When Joab saw that the line of battle was set against him both in front and in the rear, he chose some of the picked men of Israel and arrayed them against the Arameans;
the rest of his troops he put in the charge of his brother Abishai, and they were arrayed against the Ammonites.
He said, "If the Arameans are too strong for me, then you shall help me; but if the Ammonites are too strong for you, then I will help you.
Be strong, and let us be courageous for our people and for the cities of our God; and may the Lord do what seems good to him."
So Joab and the troops who were with him advanced toward the Arameans for battle; and they fled before him.
When the Ammonites saw that the Arameans fled, they likewise fled before Abishai, Joab's brother, and entered the city. Then Joab came to Jerusalem.
But when the Arameans saw that they had been defeated by Israel, they sent messengers and brought out the Arameans who were beyond the Euphrates, with Shophach the commander of the army of Hadadezer at their head.
When David was informed, he gathered all Israel together, crossed the Jordan, came to them, and drew up his forces against them. When David set the battle in array against the Arameans, they fought with him.
The Arameans fled before Israel; and David killed seven thousand Aramean charioteers and forty thousand foot soldiers, and also killed Shophach the commander of their army.
When the servants of Hadadezer saw that they had been defeated by Israel, they made peace with David, and became subject to him. So the Arameans were not willing to help the Ammonites any more.