Because David had sinned against God, the prophet Nathan had told him that he would always have trouble. The trouble started when one of his sons, Amnon, raped one of his daughters, Tamar, then another of his sons, Absalom, had Amnon killed in revenge. He ran away to his grandfather, but after three years David let him come home.
After this, Absalom decided that he would like to be king. So early every morning he would go out the gates of the city of Jerusalem. There he would greet all the people who came to see the king and asked why they were coming. When they told him, he would say, "What you want is right. How I wish I were the judge in the land, so that everyone would come to me, and I would give them justice." After he had done this for four years many people wanted him to be king. Then he told his father, "Let me go to Hebron to worship God." David said, "Go in peace," and so he went, but he did not go to worship God. Instead, he sent messengers throughout the land to say that he was to be made king in Hebron. Some of David's officials joined him there.
When David heard that Absalom had become a king, he decided he must leave Jerusalem. He started walking toward the Jordan River, crying with his head covered and his shoes off. His family and friends followed. The priests started to bring the Ark of the Covenant, but he told them to take it back to Jerusalem. He said, "If the Lord is pleased with me, some day he will let me come back to see it." When someone told David that one of his counselors, Ahithophel, was on Absalom's side, he prayed, "Lord turn Ahithophel into foolishness." Then he met another of his councilors, Hushai. He told Hushai to stay in Jerusalem and help him by giving bad advice to Absalom. So Hushai stayed there. As David walked along, one of King Saul's relatives walked along a short distance away, cursing him and throwing rocks at him. Some of David's solders wanted to kill the man, but David said, "Leave him alone. Maybe the Lord will see my trouble, and give me a blessing instead."
When Absalom came to the city, Hushai met him and said he would give him advice. When Absalom asked what to do next, Ahithophel said that they should chase David with a small army and kill him. But Hushai said that it would be best to wait until the king could raise a large army and make sure that he could kill David before he chased him. Absalom decided to follow Hushai's advice, but even so, Hushai told two of the priests' sons to run to David and tell him to cross the Jordan River that night.
Some time later many people had crossed the river to join David at the city of Mahanaim. Many others had joined Absalom's large army. Absalom led his army across the Jordan River. David's men refused to let him lead them out to fight. They were afraid he might be killed. So before he sent them out to fight, he told them, "Don't harm the young man Absalom." The two armies met in a forest and David's men won the battle. Absalom was riding on a mule and as he went under a large oak tree, he got his head caught in the branches. The mule went on and he was left hanging from the tree. When Joab, David's General, heard about it he went and killed Absalom. Then he sent a runner to tell King David. When the man came to David he said, "God has given you victory." David asked, "Is the young man Absalom all right?" The runner answered, "May what happened to him happen to all your enemies, sir." When David heard this he went to his room and cried. He said, "Absalom, oh, Absalom, if only I had died instead of you." When Joab came back he told David, "Quit crying and go see your men who saved your life." So David went out to see his men.
After that David went back to Jerusalem and became king over the Israelites once again.