Then news came to Joab, for Joab had defected to Adonijah, though he had not defected to Absalom. So Joab fled to the tabernacle of the LORD, and took hold of the horns of the altar. And King Solomon was told, “Joab has fled to the tabernacle of the LORD; there he is, by the altar.” Then Solomon sent Benaiah the son of Jehoiada, saying, “Go, strike him down.” So Benaiah went to the tabernacle of the LORD, and said to him, “Thus says the king, ‘Come out!’ ”
And he said, “No, but I will die here.” And Benaiah brought back word to the king, saying, “Thus said Joab, and thus he answered me.”
Then the king said to him, “Do as he has said, and strike him down and bury him, that you may take away from me and from the house of my father the innocent blood which Joab shed. So the LORD will return his blood on his head, because he struck down two men more righteous and better than he, and killed them with the sword—Abner the son of Ner, the commander of the army of Israel, and Amasa the son of Jether, the commander of the army of Judah—though my father David did not know it. Their blood shall therefore return upon the head of Joab and upon the head of his descendants forever. But upon David and his descendants, upon his house and his throne, there shall be peace forever from the LORD.”
So Benaiah the son of Jehoiada went up and struck and killed him; and he was buried in his own house in the wilderness. The king put Benaiah the son of Jehoiada in his place over the army, and the king put Zadok the priest in the place of Abiathar.
Then the king sent and called for Shimei, and said to him, “Build yourself a house in Jerusalem and dwell there, and do not go out from there anywhere. For it shall be, on the day you go out and cross the Brook Kidron, know for certain you shall surely die; your blood shall be on your own head.”
And Shimei said to the king, “The saying is good. As my lord the king has said, so your servant will do.” So Shimei dwelt in Jerusalem many days.
Now it happened at the end of three years, that two slaves of Shimei ran away to Achish the son of Maachah, king of Gath. And they told Shimei, saying, “Look, your slaves are in Gath!” So Shimei arose, saddled his donkey, and went to Achish at Gath to seek his slaves. And Shimei went and brought his slaves from Gath. And Solomon was told that Shimei had gone from Jerusalem to Gath and had come back. Then the king sent and called for Shimei, and said to him, “Did I not make you swear by the LORD, and warn you, saying, ‘Know for certain that on the day you go out and travel anywhere, you shall surely die’? And you said to me, ‘The word I have heard is good.’ Why then have you not kept the oath of the LORD and the commandment that I gave you?” The king said moreover to Shimei, “You know, as your heart acknowledges, all the wickedness that you did to my father David; therefore the LORD will return your wickedness on your own head. But King Solomon shall be blessed, and the throne of David shall be established before the LORD forever.”
So the king commanded Benaiah the son of Jehoiada; and he went out and struck him down, and he died. Thus the kingdom was established in the hand of Solomon.