1 Kings 2:26-35 English Standard Version (ESV)
26 And to Abiathar the priest the king said, “Go to Anathoth, to your estate, for you deserve death. But I will not at this time put you to death, because you carried the ark of the Lord God before David my father, and because you shared in all my father’s affliction.” 27 So Solomon expelled Abiathar from being priest to the Lord, thus fulfilling the word of the Lord that he had spoken concerning the house of Eli in Shiloh.
28 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. 29 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.” 30 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.” 31 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. 32 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. 33 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.” 34 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. 35 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.