When the Ammonites saw that they had made themselves hateful to David, Hanun and his people sent 1,000 talents of silver to hire for themselves chariots and horsemen from Mesopotamia, Aram-maacah, and Zobah. So they hired for themselves 32,000 chariots and the king of Maacah and his troops, who came and camped before Medeba. And the Ammonites gathered together from their cities and came to battle. When David heard about it, he sent Joab and all the army of courageous men. The Ammonites came out and lined up in battle formation at the entrance of the city [Medeba], while the kings who had come were by themselves in the open country.
Now when Joab saw that the battle was set against him in the front and in the rear, he chose warriors from all the choice men of Israel and put them in formation against the Arameans (Syrians). The rest of the soldiers he placed in the hand of Abishai his brother, and they lined up 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, I will help you. Be strong and let us show ourselves courageous for the sake of our people and for the cities of our God; and may the LORD do what is good in His sight.” So Joab and the people who were with him approached the Arameans for battle, and they fled before him. When the Ammonites saw that the Arameans fled, they also fled before Abishai, Joab’s brother, and entered the city [Medeba]. Then Joab came to Jerusalem.
When the Arameans (Syrians) saw that they had been defeated by Israel, they sent messengers and brought out the Arameans who were beyond the [Euphrates] River, with Shophach the commander of the army of Hadadezer leading them. When this was told to David, he gathered all Israel and crossed the Jordan, and came upon them and drew up in formation against them. So when David drew up in battle array against the Arameans, they fought against him. But the Arameans fled before Israel, and David killed of the Arameans 7,000 charioteers and 40,000 foot soldiers, and put to death Shophach the commander of the army. When the servants of Hadadezer saw that they had been defeated by Israel, they made peace with David and became subject to and served him. And the Arameans (Syrians) were not willing to help the Ammonites anymore.