5 "Now you yourself know what Joab son of Zeruiah did to me-what he did to the two commanders of Israel's armies, Abner son of Ner and Amasa son of Jether. He killed them, shedding their blood in peacetime as if in battle, and with that blood he stained the belt around his waist and the sandals on his feet. 6 Deal with him according to your wisdom, but do not let his gray head go down to the grave in peace. 7 "But show kindness to the sons of Barzillai of Gilead and let them be among those who eat at your table. They stood by me when I fled from your brother Absalom. 8 "And remember, you have with you Shimei son of Gera, the Benjamite from Bahurim, who called down bitter curses on me the day I went to Mahanaim. When he came down to meet me at the Jordan, I swore to him by the Lord: 'I will not put you to death by the sword.' 9 But now, do not consider him innocent. You are a man of wisdom; you will know what to do to him. Bring his gray head down to the grave in blood."

The Death of David

10 Then David rested with his ancestors and was buried in the City of David. 11 He had reigned forty years over Israel-seven years in Hebron and thirty-three in Jerusalem.

Matthew Henry's Commentary on 1 Kings 2:5-11

Commentary on 1 Kings 2:5-11

(Read 1 Kings 2:5-11)

These dying counsels concerning Joab and Shimei, did not come from personal anger, but for the security of Solomon's throne, which was the murders he had committed, but would readily repeat them to carry any purpose; though long reprieved, he shall be reckoned with at last. Time does not wear out the guilt of any sin, particularly of murder. Concerning Shimei, Hold him not guiltless; do not think him any true friend to thee, or thy government, or fit to be trusted; he has no less malice now than he had then. David's dying sentiments are recorded, as delivered under the influence of the Holy Ghost, 2 Samuel 23:1-7. The Lord discovered to him the offices and the salvation of that glorious personage, the Messiah, whose coming he then foretold, and from whom he derived all his comforts and expectations. That passage gives a decided proof that David died under the influence of the Holy Ghost, in the exercise of faith and hope.