1 Chronicles 19:9-13
9-13The Ammonites marched out and spread out in battle formation at the city gate; the kings who had come as allies took up a position in the open fields. When Joab saw that he had two fronts to fight, before and behind, he took his pick of the best of Israel and deployed them to confront the Arameans. The rest of the army he put under the command of Abishai, his brother, and deployed them to deal with the Ammonites. Then he said, "If the Arameans are too much for me, you help me; and if the Ammonites prove too much for you, I'll come and help you. Courage! We'll fight might and main for our people and for the cities of our God. And God will do whatever he sees needs doing!"
14-15But when Joab and his soldiers moved in to fight the Arameans, they ran off in full retreat. Then the Ammonites, seeing the Arameans run for dear life, took to their heels and ran from Abishai into the city.
So Joab withdrew from the Ammonites and returned to Jerusalem.