2 Samuel 17 1
Now Ahithophel urged Absalom, "Let me choose 12,000 men to start out after David tonight.
I will catch up with him while he is weary and discouraged. He and his troops will panic, and everyone will run away. Then I will kill only the king,
and I will bring all the people back to you as a bride returns to her husband. After all, it is only one man's life that you seek. 
Then you will be at peace with all the people."
This plan seemed good to Absalom and to all the elders of Israel.
Hushai Counters Ahithophel's Advice 5
But then Absalom said, "Bring in Hushai the Arkite. Let's see what he thinks about this."
When Hushai arrived, Absalom told him what Ahithophel had said. Then he asked, "What is your opinion? Should we follow Ahithophel's advice? If not, what do you suggest?"
"Well," Hushai replied to Absalom, "this time Ahithophel has made a mistake.
You know your father and his men; they are mighty warriors. Right now they are as enraged as a mother bear who has been robbed of her cubs. And remember that your father is an experienced man of war. He won't be spending the night among the troops.
He has probably already hidden in some pit or cave. And when he comes out and attacks and a few of your men fall, there will be panic among your troops, and the word will spread that Absalom's men are being slaughtered.
Then even the bravest soldiers, though they have the heart of a lion, will be paralyzed with fear. For all Israel knows what a mighty warrior your father is and how courageous his men are.
"I recommend that you mobilize the entire army of Israel, bringing them from as far away as Dan in the north and Beersheba in the south. That way you will have an army as numerous as the sand on the seashore. And I advise that you personally lead the troops.
When we find David, we'll fall on him like dew that falls on the ground. Then neither he nor any of his men will be left alive.
And if David were to escape into some town, you will have all Israel there at your command. Then we can take ropes and drag the walls of the town into the nearest valley until every stone is torn down."
Then Absalom and all the men of Israel said, "Hushai's advice is better than Ahithophel's." For the LORD had determined to defeat the counsel of Ahithophel, which really was the better plan, so that he could bring disaster on Absalom!
Hushai Warns David to Escape 15
Hushai told Zadok and Abiathar, the priests, what Ahithophel had said to Absalom and the elders of Israel and what he himself had advised instead.
"Quick!" he told them. "Find David and urge him not to stay at the shallows of the Jordan River 
tonight. He must go across at once into the wilderness beyond. Otherwise he will die and his entire army with him."
Jonathan and Ahimaaz had been staying at En-rogel so as not to be seen entering and leaving the city. Arrangements had been made for a servant girl to bring them the message they were to take to King David.
But a boy spotted them at En-rogel, and he told Absalom about it. So they quickly escaped to Bahurim, where a man hid them down inside a well in his courtyard.
The man's wife put a cloth over the top of the well and scattered grain on it to dry in the sun; so no one suspected they were there.
When Absalom's men arrived, they asked her, "Have you seen Ahimaaz and Jonathan?"
The woman replied, "They were here, but they crossed over the brook." Absalom's men looked for them without success and returned to Jerusalem.
Then the two men crawled out of the well and hurried on to King David. "Quick!" they told him, "cross the Jordan tonight!" And they told him how Ahithophel had advised that he be captured and killed.
So David and all the people with him went across the Jordan River during the night, and they were all on the other bank before dawn.
When Ahithophel realized that his advice had not been followed, he saddled his donkey, went to his hometown, set his affairs in order, and hanged himself. He died there and was buried in the family tomb.
David soon arrived at Mahanaim. By now, Absalom had mobilized the entire army of Israel and was leading his troops across the Jordan River.
Absalom had appointed Amasa as commander of his army, replacing Joab, who had been commander under David. (Amasa was Joab's cousin. His father was Jether, 
an Ishmaelite. 
His mother, Abigail daughter of Nahash, was the sister of Joab's mother, Zeruiah.)
Absalom and the Israelite army set up camp in the land of Gilead.
When David arrived at Mahanaim, he was warmly greeted by Shobi son of Nahash, who came from Rabbah of the Ammonites, and by Makir son of Ammiel from Lo-debar, and by Barzillai of Gilead from Rogelim.
They brought sleeping mats, cooking pots, serving bowls, wheat and barley, flour and roasted grain, beans, lentils,
honey, butter, sheep, goats, and cheese for David and those who were with him. For they said, "You must all be very hungry and tired and thirsty after your long march through the wilderness."