In 18:919:8a we have an account of the death of Absalom.
Absalom, riding upon a mule, met the servants of David. The mule went under the tangled branches of a great tree, and Absalom's head was caught in the tree. He was left hanging between heaven and earth while the mule that was under him went on (v. 9).
A certain man saw this and told Joab that he had just seen Absalom hanging from a tree (v. 10).
Joab asked that man why he did not strike Absalom down to the ground (vv. 11-13). That man said that he would not put his hand against the son of the king, for the king had commanded that they take care of Absalom.
Joab took three staves and thrust them through Absalom's heart while he was still alive in the midst of the tree, and the ten young men who carried Joab's armor surrounded Absalom, struck him, and killed him (vv. 14-15).
Joab blew the trumpet, and the people returned from pursuing after Israel. Then they took Absalom and threw him into a great pit in the forest and cast up over him a very great mound of stones (vv. 16-17).
While Absalom was alive, he had taken a pillar which was in the king's valley and raised it up for himself, saying, "I have no son to keep my name in remembrance." He called the pillar by his own name, and it was called Absalom's Monument (v. 18).
Ahimaaz the son of Zadok the high priest wanted to announce the news to David, but Joab prohibited him and asked the Cushite to do it. When the Cushite came to David, he told the king that Jehovah had avenged him of all who had risen up against him (vv. 19-32).
David was much concerned for his son Absalom, twice asking, "Is all well with the young man Absalom?" (vv. 29a, 32a). When he heard about Absalom's death, he wept grievously. "The king was badly shaken, and he went up to the chamber over the gate and wept. And as he went, he spoke thus, O my son Absalom! My son, my son Absalom! If only I had died instead of you! O Absalom, my son, my son!" (v. 33).
In 19:1-8a Joab advised David to comfort the people by quieting himself.