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 each of the laws, commands, regulations, and stipulations 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: '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 that Joab son of Zeruiah 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 the blood of war.
References for 1 Kings 2:5
Do with him what you think best, but don't let him die in peace."
"Be kind to the sons of Barzillai of Gilead. Make them permanent guests of the king, 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 in the City of David.
He had reigned over Israel for forty years, seven of them in Hebron and thirty-three in Jerusalem.
Solomon succeeded him as king, replacing his father, David, and he was firmly established on the throne.
One day Adonijah, whose mother was Haggith, came to see Bathsheba, Solomon's mother. "Have you come to make trouble?" she asked him. "No," 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 mine; everyone expected me to be the next king. But the tables were turned, and everything 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 give me Abishag, the girl from Shunem, as my wife."
"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, he 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?" Solomon demanded. "You might as well be asking 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 swore solemnly by the LORD: "May God strike me dead 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 my father, and you suffered right along with him through all his troubles."
So Solomon deposed Abiathar from his position as priest of the LORD, thereby fulfilling the decree the LORD had made at Shiloh concerning the descendants of Eli.
Although he had not followed Absalom earlier, Joab had also joined Adonijah's revolt. When Joab heard about Adonijah's death, he ran to the sacred tent of the LORD and caught hold of the horns of the altar.
When news of this reached King Solomon, he sent Benaiah son of Jehoiada to execute him.
Benaiah went into 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 his senseless murders from me and from my father's family.
Then the LORD will repay him for the murders of two men who were more righteous and better than he. For my father was no party to the deaths of Abner son of Ner, commander of the army of Israel, and Amasa son of Jether, commander of the army of Judah.
May Joab and his descendants be forever guilty of these murders, and may the LORD grant peace to David and his descendants and to his throne forever."
So Benaiah son of Jehoiada returned to the sacred tent and killed Joab, and Joab 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 cross the Kidron Valley, you will surely die; 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 escaped to King Achish of Gath. When Shimei learned where they were,
he saddled his donkey and went to Gath to search for them. When he had found them, he took them back to Jerusalem.
Solomon heard that Shimei had left Jerusalem and had gone to Gath and returned.
So he 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 surely remember all the wicked things you did to my father, King David. May the LORD punish you for them.
But may I receive the LORD's rich blessings, and may one of David's descendants always sit on this throne."
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.