1 Kings 2:30-46

2:30 When Benaiah arrived at the tent of the Lord, he said to him, “The king says, ‘Come out!’” But he replied, “No, I will die here!” So Benaiah sent word to the king and reported Joab’s reply. 2:31 The king told him, “Do as he said! Strike him down and bury him. Take away from me and from my father’s family the guilt of Joab’s murderous, bloody deeds. 2:32 May the Lord punish him for the blood he shed; behind my father David’s back he struck down and murdered with the sword two men who were more innocent and morally upright than he – Abner son of Ner, commander of Israel’s army, and Amasa son of Jether, commander of Judah’s army. 2:33 May Joab and his descendants be perpetually guilty of their shed blood, but may the Lord give perpetual peace to David, his descendants, his family, and his dynasty.” 2:34 So Benaiah son of Jehoiada went up and executed Joab; he was buried at his home in the wilderness. 2:35 The king appointed Benaiah son of Jehoiada to take his place at the head of the army, and the king appointed Zadok the priest to take Abiathar’s place.

2:36 Next the king summoned Shimei and told him, “Build yourself a house in Jerusalem and live there – but you may not leave there to go anywhere! 2:37 If you ever do leave and cross the Kidron Valley, know for sure that you will certainly die! You will be responsible for your own death.” 2:38 Shimei said to the king, “My master the king’s proposal is acceptable. Your servant will do as you say.” So Shimei lived in Jerusalem for a long time.

2:39 Three years later two of Shimei’s servants ran away to King Achish son of Maacah of Gath. Shimei was told, “Look, your servants are in Gath.” 2:40 So Shimei got up, saddled his donkey, and went to Achish at Gath to find his servants; Shimei went and brought back his servants from Gath. 2:41 When Solomon was told that Shimei had gone from Jerusalem to Gath and had then returned, 2:42 the king summoned Shimei and said to him, “You will recall that I made you take an oath by the Lord, and I solemnly warned you, ‘If you ever leave and go anywhere, know for sure that you will certainly die.’ You said to me, ‘The proposal is acceptable; I agree to it.’ 2:43 Why then have you broken the oath you made before the Lord and disobeyed the order I gave you?” 2:44 Then the king said to Shimei, “You are well aware of the way you mistreated my father David. The Lord will punish you for what you did. 2:45 But King Solomon will be empowered and David’s dynasty will endure permanently before the Lord.” 2:46 The king then gave the order to Benaiah son of Jehoiada who went and executed Shimei.

So Solomon took firm control of the kingdom.