1 Kings 2:31
And the king said unto him, Do as he hath said, and fall upon him, and bury him; that thou mayest take away the innocent blood, which Joab shed, from me, and from the house of my father. And the king said unto him, Do as he hath said, and fall upon him, and bury him; that thou mayest take away the innocent blood, which Joab shed, from me, and from the house of my father.
The verse falls within the account of Solomon's reign, the period of the undivided kingdom under Solomon covered in 1 Kings 1-11. It shows Solomon carrying out David's charge to secure the throne after David's death, among the measures taken to establish Solomon's reign. It belongs to the account of Solomon securing the throne after Adonijah's attempt to take it and Joab's failure of loyalty to the king, and it records Joab's death as part of the response to his disloyalty.
The verse records Solomon ordering Joab to be executed and buried so that the innocent blood Joab had shed and responsibility for it would be removed from Solomon and from David and his father's house. Joab was put to death after a further offense and insult to the king. His death was carried out as just punishment for the blood he had shed. He was taken from the altar where he had sought refuge and put to death, showing that the altar did not protect him from punishment for his crime. The place where he died showed his belief in Jehovah.
Joab's death was the last result of jealousy that developed in him and exposed a regrettable weakness in his character. In the account of Adonijah's attempted seizure of the throne, Joab's death is another consequence of the violence and turmoil that marked David's family. The chapter to which the verse belongs is part of the subsequent history of David showing how completely Nathan's denunciation after David's wickedness in the case of Uriah was accomplished in judgments upon David, showing that the sacred writers do not cover up or excuse that transgression. In connection with this chapter, Shimei later feared and trembled for his life after David returned to power, and his fate was the just reward for cursing David during his adversity.