The time came near for David to die; so he commissioned Shlomo his son as follows:
"I am going the way of all the earth. Therefore, be strong; show yourself a man.
Observe the charge of ADONAI your God to go in his ways and keep his regulations, mitzvot, rulings and instructions in accordance with what is written in the Torah of Moshe; so that you will succeed in all you do and wherever you go.
If you do, ADONAI will fulfill what he promised me when he said, 'If your children pay attention to how they live, conducting themselves before me honestly with all their heart and being, you will never lack a man on the throne of Isra'el.'
"Moreover, you are aware of what Yo'av the son of Tz'ruyah did to me, that is, what he did to the two commanders of the armies of Isra'el, Avner the son of Ner and 'Amasa the son of Yeter - he killed them, shedding the blood of war in peacetime, putting the blood of war on the belt around his waist and the shoes on his feet.
Therefore, act according to your wisdom; don't let his gray head go down to the grave in peace.
"But show kindness to the sons of Barzillai the Gil'adi. Include them with those who eat at your table, because they came and stood with me when I was fleeing from Avshalom your brother.
"Finally, you have with you Shim'i the son of Gera the Binyamini, from Bachurim. He laid a terrible curse on me when I was on my way to Machanayim; but he came down to meet me at the Yarden; so I swore to him by ADONAI that I would not have him put to death with the sword.
Now, however, you should not let him go unpunished. You are a wise man, and you will know what you should do to him - you will bring his gray head down to the grave with blood."
Then David slept with his ancestors and was buried in the City of David.
David had ruled Isra'el for forty years - seven years in Hevron and thirty-three years in Yerushalayim.
Shlomo sat on the throne of David his father; and his rule had become firmly established,
when Adoniyah the son of Haggit came to Bat-Sheva the mother of Shlomo. She asked, "Have you come as a friend?" He answered, "Yes, as a friend."
Then he continued, "I have something to say to you." She said, "Go on."
He said, "You know that the kingdom should have been mine, that all Isra'el was looking to me to be their ruler. No matter; the kingdom has turned around and become my brother's, because ADONAI gave it to him.
But now I ask one favor of you; don't deny me." "Go on," she said.
He said, "Please speak to Shlomo the king - for he won't say 'No' to you - and ask him to give me Avishag the Shunamit as my wife."
Bat-Sheva said, "All right, I will speak to the king on your behalf."
So Bat-Sheva went to King Shlomo to speak to him on behalf of Adoniyah. The king rose to meet her and bowed down to her. Then he sat down on his throne and had a throne set up for the king's mother, so that she sat at his right.
She said, "I am asking one small favor of you; don't deny me." The king said to her, "Ask, mother; I won't deny you."
She said, "Let Avishag the Shunamit be given to Adoniyah your brother as his wife."
King Shlomo answered his mother, "Why are you asking Avishag the Shunamit for Adoniyah? Ask the kingdom for him too! After all, he's my older brother! Yes, for him, and for Evyatar the cohen and for Yo'av the son of Tz'ruyah!"
Then King Shlomo swore by ADONAI, "May God do terrible things to me and worse if Adoniyah hasn't condemned himself to death with this request!
Now therefore, as ADONAI lives, who has established me, put me on the throne of David my father and set up a dynasty for me, as he promised, Adoniyah will certainly be put to death today."
King Shlomo commissioned B'nayah the son of Y'hoyada, and he struck him down, so that he died.
To Evyatar the cohen the king said, "You, get yourself to 'Anatot, to your own fields. You deserve to die; but I won't put you to death just now; since you did carry the ark of Adonai ELOHIM before David my father; and you suffered together with my father in everything he suffered."
So Shlomo forced Evyatar out of his task as cohen to ADONAI, so that what ADONAI had said in Shiloh about the family of 'Eli might be fulfilled.
When the news came to Yo'av, he fled to the tent of ADONAI and took hold of the horns of the altar; for Yo'av had given his support to Adoniyah, even though he had not supported Avshalom.
King Shlomo was told, "Yo'av has fled to the tent of ADONAI; he's there by the altar." Shlomo sent B'nayah the son of Y'hoyada with the order, "Go, strike him down."
B'nayah came to the tent of ADONAI and said to him, "The king says: leave!" He answered, "No, I'd rather die here." B'nayah brought the message back to the king, "This is what Yo'av said to me."
The king answered him, "Do what he said - strike him down, and bury him. In this way you will take away from me and my father's family the blood which Yo'av shed for no reason.
ADONAI will bring his blood back on his own head, because he struck down two men more righteous and better than he - he killed them with the sword without my father David's awareness: Avner the son of Ner, commander of the army of Isra'el, and 'Amasa the son of Yeter, commander of the army of Y'hudah.
In this way their blood will return on the head of Yo'av and his descendants forever; but for David, his descendants, his family and his throne there will be peace forever from ADONAI."
So B'nayah the son of Y'hoyada went up, struck him down and killed him; he was buried in his own house in the desert.
The king put B'nayah the son of Y'hoyada in charge of the army instead of him, and the king replaced Evyatar with Tzadok the cohen.
The king summoned Shim'i and said to him, "Build yourself a house in Yerushalayim, and live there; don't go outside the city walls.
Know for a fact that on the day you go out and cross Vadi Kidron, you will certainly die; your blood will be on your own head."
Shim'i answered the king, "What you have said is good; as my lord the king has said, so will your servant do." So Shim'i lived in Yerushalayim for a long time.
But after three years, two of Shim'i's slaves ran away and went to Akhish son of Ma'akhah, king of Gat. They told Shim'i, "Your slaves are in Gat."
So Shim'i set out, saddled his donkey and went to Akhish in Gat to look for his slaves; then Shim'i returned, bringing his slaves from Gat.
Shlomo was told that Shim'i had gone from Yerushalayim to Gat and back.
The king summoned Shim'i and said to him, "Didn't I have you swear by ADONAI and forewarn you by telling you, 'Know for a fact that on the day you leave and go anywhere outside the city, you will certainly die'? and you answered me, 'What you're saying is good; I hear it.'
Why, then, haven't you kept the oath of ADONAI and the mitzvah I charged you with?"
Moreover, the king said to Shim'i, "You know in your own heart all the terrible things you did to David my father; therefore ADONAI will bring back your wickedness on your own head.
But King Shlomo will be blessed, and the throne of David will be established before ADONAI forever."
So the king gave the order to B'nayah the son of Y'hoyada, and he went out and struck him down, so that he died. Thus the kingdom was established in Shlomo's hands.