When the Ammonites saw that they had become a stench to David, the Ammonites sent and hired the Syrians of Beth-rehob, and the Syrians of Zobah, 20,000 foot soldiers, and the king of Maacah with 1,000 men, and the men of Tob, 12,000 men. And when David heard of it, he sent Joab and all the host of the mighty men. And the Ammonites came out and drew up in battle array at the entrance of the gate, and the Syrians of Zobah and of Rehob and the men of Tob and Maacah were by themselves in the open country.
When Joab saw that the battle was set against him both in front and in the rear, he chose some of the best men of Israel and arrayed them against the Syrians. The rest of his men he put in the charge of Abishai his brother, and he arrayed them against the Ammonites. And he said, “If the Syrians are too strong for me, then you shall help me, but if the Ammonites are too strong for you, then I will come and help you. Be of good courage, 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 people who were with him drew near to battle against the Syrians, and they fled before him. And when the Ammonites saw that the Syrians fled, they likewise fled before Abishai and entered the city. Then Joab returned from fighting against the Ammonites and came to Jerusalem.
But when the Syrians saw that they had been defeated by Israel, they gathered themselves together. And Hadadezer sent and brought out the Syrians who were beyond the Euphrates. They came to Helam, with Shobach the commander of the army of Hadadezer at their head. And when it was told David, he gathered all Israel together and crossed the Jordan and came to Helam. The Syrians arrayed themselves against David and fought with him. And the Syrians fled before Israel, and David killed of the Syrians the men of 700 chariots, and 40,000 horsemen, and wounded Shobach the commander of their army, so that he died there. And when all the kings who were servants of Hadadezer saw that they had been defeated by Israel, they made peace with Israel and became subject to them. So the Syrians were afraid to save the Ammonites anymore.