Now when the sons of Ammon saw that they had become odious to David, the sons of Ammon sent and hired the Arameans of Beth-rehob and the Arameans of Zobah, 20,000 foot soldiers, and the king of Maacah with 1,000 men, and the men of Tob with 12,000 men. When David heard of it, he sent Joab and all the army, the mighty men. The sons of Ammon came out and drew up in battle array at the entrance of the city, while the Arameans of Zobah and of Rehob and the men of Tob and Maacah were by themselves in the field.
Now when Joab saw that the battle was set against him in front and in the rear, he selected from all the choice men of Israel, and arrayed them against the Arameans. But the remainder of the people he placed in the hand of Abishai his brother, and he arrayed them against the sons of Ammon. He said, “If the Arameans are too strong for me, then you shall help me, but if the sons of Ammon are too strong for you, then I will come to 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 drew near to the battle against the Arameans, and they fled before him. When the sons of Ammon saw that the Arameans fled, they also fled before Abishai and entered the city. Then Joab returned from fighting against the sons of Ammon and came to Jerusalem.
When the Arameans saw that they had been defeated by Israel, they gathered themselves together. And Hadadezer sent and brought out the Arameans who were beyond the River, and they came to Helam; and Shobach the commander of the army of Hadadezer led them. Now when it was told David, he gathered all Israel together and crossed the Jordan, and came to Helam. And the Arameans arrayed themselves to meet David and fought against him. But the Arameans fled before Israel, and David killed 700 charioteers of the Arameans and 40,000 horsemen and struck down Shobach the commander of their army, and he died there. When all the kings, servants of Hadadezer, saw that they were defeated by Israel, they made peace with Israel and served them. So the Arameans feared to help the sons of Ammon anymore.