Joab had not joined Absalom’s earlier rebellion, but he had joined Adonijah’s rebellion. So when Joab heard about Adonijah’s death, he ran to the sacred tent of the LORD and grabbed on to the horns of the altar. When this was reported to King Solomon, he sent Benaiah son of Jehoiada to execute him.
Benaiah went to the sacred tent of the LORD and said to Joab, “The king orders you to come out!”
But Joab answered, “No, I will die here.”
So Benaiah returned to the king and told him what Joab had said.
“Do as he said,” the king replied. “Kill him there beside the altar and bury him. This will remove the guilt of Joab’s senseless murders from me and from my father’s family. The LORD will repay him for the murders of two men who were more righteous and better than he. For my father knew nothing about the deaths of Abner son of Ner, commander of the army of Israel, and of Amasa son of Jether, commander of the army of Judah. May their blood be on Joab and his descendants forever, and may the LORD grant peace forever to David, his descendants, his dynasty, and his throne.”
So Benaiah son of Jehoiada returned to the sacred tent and killed Joab, and he was buried at his home in the wilderness. Then the king appointed Benaiah to command the army in place of Joab, and he installed Zadok the priest to take the place of Abiathar.
The king then sent for Shimei and told him, “Build a house here in Jerusalem and live there. But don’t step outside the city to go anywhere else. On the day you so much as cross the Kidron Valley, you will surely die; and your blood will be on your own head.”
Shimei replied, “Your sentence is fair; I will do whatever my lord the king commands.” So Shimei lived in Jerusalem for a long time.
But three years later two of Shimei’s slaves ran away to King Achish son of Maacah of Gath. When Shimei learned where they were, he saddled his donkey and went to Gath to search for them. When he found them, he brought them back to Jerusalem.
Solomon heard that Shimei had left Jerusalem and had gone to Gath and returned. So the king sent for Shimei and demanded, “Didn’t I make you swear by the LORD and warn you not to go anywhere else or you would surely die? And you replied, ‘The sentence is fair; I will do as you say.’ Then why haven’t you kept your oath to the LORD and obeyed my command?”
The king also said to Shimei, “You certainly remember all the wicked things you did to my father, David. May the LORD now bring that evil on your own head. But may I, King Solomon, receive the LORD’s blessings, and may one of David’s descendants always sit on this throne in the presence of the LORD.” Then, at the king’s command, Benaiah son of Jehoiada took Shimei outside and killed him.
So the kingdom was now firmly in Solomon’s grip.