When the news came to Joab—for Joab had supported Adonijah although he had not supported Absalom—Joab fled to the tent of the LORD and caught hold of the horns of the altar. And when it was told King Solomon, “Joab has fled to the tent of the LORD, and behold, he is beside the altar,” Solomon sent Benaiah the son of Jehoiada, saying, “Go, strike him down.” So Benaiah came to the tent of the LORD and said to him, “The king commands, ‘Come out.’” But he said, “No, I will die here.” Then Benaiah brought the king word again, saying, “Thus said Joab, and thus he answered me.” The king replied to him, “Do as he has said, strike him down and bury him, and thus take away from me and from my father’s house the guilt for the blood that Joab shed without cause. The LORD will bring back his bloody deeds on his own head, because, without the knowledge of my father David, he attacked and killed with the sword two men more righteous and better than himself, Abner the son of Ner, commander of the army of Israel, and Amasa the son of Jether, commander of the army of Judah. So shall their blood come back on the head of Joab and on the head of his descendants forever. But for David and for his descendants and for his house and for his throne there shall be peace from the LORD forevermore.” Then Benaiah the son of Jehoiada went up and struck him down and put him to death. And he was buried in his own house in the wilderness. The king put Benaiah the son of Jehoiada over the army in place of Joab, and the king put Zadok the priest in the place of Abiathar.
Then the king sent and summoned Shimei and said to him, “Build yourself a house in Jerusalem and dwell there, and do not go out from there to any place whatever. For on the day you go out and cross the brook Kidron, know for certain that you shall die. Your blood shall be on your own head.” And Shimei said to the king, “What you say is good; as my lord the king has said, so will your servant do.” So Shimei lived in Jerusalem many days.
But it happened at the end of three years that two of Shimei’s servants ran away to Achish, son of Maacah, king of Gath. And when it was told Shimei, “Behold, your servants are in Gath,” Shimei arose and saddled a donkey and went to Gath to Achish to seek his servants. Shimei went and brought his servants from Gath. And when Solomon was told that Shimei had gone from Jerusalem to Gath and returned, the king sent and summoned Shimei and said to him, “Did I not make you swear by the LORD and solemnly warn you, saying, ‘Know for certain that on the day you go out and go to any place whatever, you shall die’? And you said to me, ‘What you say is good; I will obey.’ Why then have you not kept your oath to the LORD and the commandment with which I commanded you?” The king also said to Shimei, “You know in your own heart all the harm that you did to David my father. So the LORD will bring back your harm on your own head. But King Solomon shall be blessed, and the throne of David shall be established before the LORD forever.” Then the king commanded Benaiah the son of Jehoiada, and he went out and struck him down, and he died.
So the kingdom was established in the hand of Solomon.