In the spring, at the time of year when kings go out to war, David sent out Joab and his officers and the whole Israelite army on an attack. They massacred the Ammonites and besieged Rabbah. However, David remained behind in Jerusalem.
Then David said to the messenger, “Tell Joab this: ‘Don't be upset about this, for the sword destroys people at random. Press on with your attack against the town and conquer it.’ Encourage him by telling him this.”
When David arrived at Mahanaim, he was welcomed by Shobi, son of Nahash, from Rabbah of the Ammonites, Machir, son of Ammiel, from Lo-debar, and Barzillai the Gileadite from Rogelim.
(Only Og, king of Bashan, was left of the race of the Rephaim. He had a bed made of iron that was nine cubits long and four cubits wide. It's still in the Ammonite town of Rabbah.)