2 Samuel 10:14
And when the children of Ammon saw that the Syrians were fled, then fled they also before Abishai, and entered into the city. So Joab returned from the children of Ammon, and came to Jerusalem. And when the children of Ammon saw that the Syrians were fled, then fled they also before Abishai, and entered into the city. So Joab returned from the children of Ammon, and came to Jerusalem.
This verse records the first defeat in a vast unprovoked coalition war against David, sprung from jealousy of his increasing power, which brought the greatest wars and victories of his reign and the most extensive additions to his power. The war began when David sent ambassadors with sympathy to Hanun son of Nahash to repay kindness Nahash had shown David while a fugitive, but Hanun's counselors misconstrued the visit as spying to search out and overthrow the city, and Hanun met the ambassadors with scorn and insult, though the office of ambassador was sacred by the universal law of nations and any indignity to it demanded prompt retaliation. Behind the insult, the Ammonites hated the true God and were bitter enemies of Israel, still remembering how Israel had foiled Nahash's cruel demand to thrust out all the right eyes of Jabesh-gilead, and God permitted them to carry out the evil purposes of their hearts to reveal their real treacherous character and to show Israel that it should make no league with them.
Having made themselves odious to David, Hanun and the Ammonites sent a thousand talents of silver to hire thirty-two thousand chariots and horsemen from Mesopotamia and Syria-maachah and Zobah and gathered men from their cities to battle, with inhabitants between the Euphrates and the Mediterranean leagued with them, so that the north and east of Canaan was encircled with armed foes banded to crush Israel. Instead of waiting for invasion, Israel took the offensive when Joab led the forces across the Jordan toward the Ammonite capital, and before the battle he urged the army to be of good courage and behave valiantly for their people and for the cities of God, leaving the result to the Lord to do what is good in His sight. In that first engagement the united Ammonite and Syrian forces were overcome, and when the Ammonites saw that the Syrians had fled, they also fled before Abishai and entered into the city, after which Joab returned from the Ammonites to Jerusalem.
That success did not end the war, for the allies renewed the contest the next year with an immense Syrian army that David met in person and by the blessing of God defeated so disastrously that the Syrians from Lebanon to the Euphrates gave up the war and became tributary to Israel, while David pushed the war against the Ammonites with vigor until their strongholds fell and the whole region came under the dominion of Israel.