1 Kings 2
David's Final Instructions to Solomon 1
As the time of King David's death approached, he gave this charge to his son Solomon:
"I am going where everyone on earth must someday go. Take courage and be a man.
Observe the requirements of the LORD your God, and follow all his ways. Keep the decrees, commands, regulations, and laws written in the Law of Moses so that you will be successful in all you do and wherever you go.
If you do this, then the LORD will keep the promise he made to me. He told me, `If your descendants live as they should and follow me faithfully with all their heart and soul, one of them will always sit on the throne of Israel.'
"And there is something else. You know what Joab son of Zeruiah did to me when he murdered my two army commanders, Abner son of Ner and Amasa son of Jether. He pretended that it was an act of war, but it was done in a time of peace, 
staining his belt and sandals with innocent blood. 
Do with him what you think best, but don't let him grow old and go to his grave in peace. 
"Be kind to the sons of Barzillai of Gilead. Make them permanent guests at your table, for they took care of me when I fled from your brother Absalom.
"And remember Shimei son of Gera, the man from Bahurim in Benjamin. He cursed me with a terrible curse as I was fleeing to Mahanaim. When he came down to meet me at the Jordan River, I swore by the LORD that I would not kill him.
But that oath does not make him innocent. You are a wise man, and you will know how to arrange a bloody death for him. 
Then David died and was buried with his ancestors in the City of David.
David had reigned over Israel for forty years, seven of them in Hebron and thirty-three in Jerusalem.
Solomon became king and sat on the throne of David his father, and his kingdom was firmly established.
Solomon Establishes His Rule 13
One day Adonijah, whose mother was Haggith, came to see Bathsheba, Solomon's mother. "Have you come with peaceful intentions?" she asked him.
"Yes," he said, "I come in peace.
In fact, I have a favor to ask of you."
"What is it?" she asked.
He replied, "As you know, the kingdom was rightfully mine; all Israel wanted me to be the next king. But the tables were turned, and the kingdom went to my brother instead; for that is the way the LORD wanted it.
So now I have just one favor to ask of you. Please don't turn me down."
"What is it?" she asked.
He replied, "Speak to King Solomon on my behalf, for I know he will do anything you request. Ask him to let me marry Abishag, the girl from Shunem."
"All right," Bathsheba replied. "I will speak to the king for you."
So Bathsheba went to King Solomon to speak on Adonijah's behalf. The king rose from his throne to meet her, and he bowed down before her. When he sat down on his throne again, the king ordered that a throne be brought for his mother, and she sat at his right hand.
"I have one small request to make of you," she said. "I hope you won't turn me down."
"What is it, my mother?" he asked. "You know I won't refuse you."
"Then let your brother Adonijah marry Abishag, the girl from Shunem," she replied.
"How can you possibly ask me to give Abishag to Adonijah?" King Solomon demanded. "You might as well ask me to give him the kingdom! You know that he is my older brother, and that he has Abiathar the priest and Joab son of Zeruiah on his side."
Then King Solomon made a vow before the LORD: "May God strike me and even kill me if Adonijah has not sealed his fate with this request.
The LORD has confirmed me and placed me on the throne of my father, David; he has established my dynasty as he promised. So as surely as the LORD lives, Adonijah will die this very day!"
So King Solomon ordered Benaiah son of Jehoiada to execute him, and Adonijah was put to death.
Then the king said to Abiathar the priest, "Go back to your home in Anathoth. You deserve to die, but I will not kill you now, because you carried the Ark of the Sovereign LORD for David my father and you shared all his hardships."
So Solomon deposed Abiathar from his position as priest of the LORD, thereby fulfilling the prophecy the LORD had given at Shiloh concerning the descendants of Eli.
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 onto 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.