So David lay down with his fathers [in death] and was buried in the City of David. The time that David reigned over Israel was forty years: he reigned seven years in Hebron and thirty-three years in Jerusalem. Then Solomon sat on the throne of David his father, and his kingdom was firmly established.
Now Adonijah the son of [David and] Haggith came to Bathsheba the mother of Solomon. She said, “Do you come in peace?” And he said, “In peace.” Then he said, “I have something to say to you.” And she said, “Speak.” So he said, “You know that the kingdom belonged to me [as the eldest living son] and all Israel looked to me and expected me to be king. However, the kingdom has passed [from me] and became my brother’s, for it was his from the LORD. So now I am making one request of you; do not refuse me.” And she said to him, “Speak.” He said, “Please speak to King Solomon, for he will not refuse you; ask that he may give me Abishag the Shunammite as a wife.” [1 Kin 1:1-4] Bathsheba replied, “Very well; I will speak to the king for you.”
So Bathsheba went to King Solomon to speak to him for Adonijah. And the king rose to meet her, bowed before her, and sat down on his throne; then he had a throne set for her, the king’s mother, and she sat on his right. Then she said, “I am making one small request of you; do not refuse me.” And the king said to her, “Ask, my mother, for I will not refuse you.” So she said, “Let Abishag the Shunammite be given to your brother Adonijah as a wife.” King Solomon answered and said to his mother, “And why are you asking for Abishag the Shunammite for Adonijah? Ask the kingdom for him also—since he is my older brother—[ask it] for him and for Abiathar the priest and Joab the son of Zeruiah [his supporters]!” Then King Solomon swore by the LORD, saying, “May God do the same to me, and more also, if Adonijah has not requested this [deplorable] thing against his own life. So now, as the LORD lives, who has established me and set me on the throne of David my father, and who has made me a house as He promised, Adonijah shall indeed be put to death today.” So King Solomon sent Benaiah the son of Jehoiada, and he struck Adonijah and he died.
Then the king said to Abiathar the priest, “Go to Anathoth to your own fields, for you certainly deserve to die; but I will not put you to death this day, because you carried the ark of the Lord GOD before my father David, and you suffered everything that my father endured.” So Solomon dismissed Abiathar [a descendant of Eli] from being priest to the LORD, fulfilling the word of the LORD, which He had spoken concerning the house (descendants) of Eli in Shiloh. [1 Sam 2:27-36]
Now the news reached Joab, for Joab had supported and followed Adonijah, although he had not followed Absalom. So Joab fled to the [sacred] tent of the LORD and took hold of the horns of the altar [to seek asylum]. King Solomon was told that Joab had fled to the tent of the LORD and was at that moment beside the altar. Then Solomon sent Benaiah the son of Jehoiada, saying, “Go, strike him down.” So Benaiah came to the tent of the LORD and told Joab, “This is what the king commands, ‘Come out of there.’ ” But Joab said, “No, for I will die here.” Then Benaiah brought word to the king again, saying, “This is what Joab said, and this is how he answered me.” The king said to him, “Do as he has said. Strike him down and bury him, so that you may remove from me and from my father’s house the innocent blood which Joab shed. The LORD will return his bloody deeds upon his own head, because he struck down two men more righteous and honorable than he and killed them with the sword, without my father David knowing: 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 return on the head of Joab and the heads of his descendants forever. But for David, his descendants, his house, and his throne, may there be peace from the LORD forever.” So Benaiah the son of Jehoiada went up [to the tabernacle] and struck and killed Joab, and he was buried at his own house in the wilderness [of Judah]. The king appointed Benaiah the son of Jehoiada over the army in Joab’s place, and appointed Zadok the priest in place of Abiathar.
Now the king sent word and called for Shimei and said to him, “Build yourself a house in Jerusalem and live there. Do not go from there to any other place. For on the day you leave and cross over the Brook Kidron, know for certain that you shall surely die; your blood shall be on your own head.” Shimei said to the king, “The word (ruling) is good. As my lord the king has said, so will your servant do.” So Shimei lived in Jerusalem for many days.
But it happened after three years, that two of Shimei’s servants ran away to Achish the son of Maacah, the king of Gath. And Shimei was told, “Behold, your [runaway] servants are in Gath.” So Shimei arose, saddled his donkey, and went to Gath to [King] Achish to look for his servants. And Shimei went and brought them back from Gath. Now Solomon was told that Shimei had gone from Jerusalem to Gath, and had returned. So the king sent word and called for 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 leave [Jerusalem] and go anywhere, you shall surely die’? And you said to me, ‘The word (ruling) I have heard is good.’ Why then have you not kept the oath of the LORD, and the command which I gave you?” The king also said to Shimei, “You are aware in your own heart of all the evil you did to my father David; so the LORD shall return your evil 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 down Shimei, and he died.
S o the kingdom was established in the hands of Solomon.