Jonathan and David make a covenant of friendship. Saul sets David over his armies. David is honored by the Israelites for his success in battle. Saul becomes jealous of David and tries to kill him with a javelin (note that the Joseph Smith Translation of 1 Samuel 18:10 indicates that the evil spirit that came upon Saul was not from God).

1 Samuel 18:1–16

1 And it came to pass, when he had made an end of speaking unto Saul, that the soul of Jonathan was knit with the soul of David, and Jonathan loved him as his own soul.
2 And Saul took him that day, and would let him go no more home to his father’s house.
3 Then Jonathan and David made a covenant, because he loved him as his own soul.
4 And Jonathan stripped himself of the robe that was upon him, and gave it to David, and his garments, even to his sword, and to his bow, and to his girdle.
5 And David went out whithersoever Saul sent him, and behaved himself wisely: and Saul set him over the men of war, and he was accepted in the sight of all the people, and also in the sight of Saul’s servants.
6 And it came to pass as they came, when David was returned from the slaughter of the Philistine, that the women came out of all cities of Israel, singing and dancing, to meet king Saul, with tabrets, with joy, and with instruments of musick.
7 And the women answered one another as they played, and said, Saul hath slain his thousands, and David his ten thousands.
8 And Saul was very wroth, and the saying displeased him; and he said, They have ascribed unto David ten thousands, and to me they have ascribed but thousands: and what can he have more but the kingdom?
9 And Saul eyed David from that day and forward.
10 And it came to pass on the morrow, that the evil spirit from God came upon Saul, and he prophesied in the midst of the house: and David played with his hand, as at other times: and there was a javelin in Saul’s hand.
11 And Saul cast the javelin; for he said, I will smite David even to the wall with it. And David avoided out of his presence twice.
12 And Saul was afraid of David, because the Lord was with him, and was departed from Saul.
13 Therefore Saul removed him from him, and made him his captain over a thousand; and he went out and came in before the people.
14 And David behaved himself wisely in all his ways; and the Lord was with him.
15 Wherefore when Saul saw that he behaved himself very wisely, he was afraid of him.
16 But all Israel and Judah loved David, because he went out and came in before them.

Elder Lynn A. Mickelsen said:

“The Old Testament contains the inspiring story of David and Jonathan, who achieved true friendship despite difficult circumstances.

“Although David may not have seemed the logical choice to be king of Israel, the Lord chose him to succeed King Saul. Young David developed the attributes that qualified him for this honor as he responsibly tended his father’s flocks, learning to obey faithfully both the mortal direction and the spiritual promptings he received. He was trustworthy, unselfish, fearless, and confident, and he had unwavering faith in the God of Israel. These attributes were clearly evident in his astonishing victory over Goliath.

“Jonathan, the son of King Saul, had also proven himself courageous and faithful. Traditionally he would have been heir to the throne instead of David, so it would have been natural for him to see David as his enemy. Yet when David returned from the battlefield and appeared in King Saul’s court ‘with the head of [Goliath] in his hand[,] . . . the soul of Jonathan was knit with the soul of David, and Jonathan loved him as his own soul’ (1 Samuel 17:57; 18:1).

“Jonathan’s love for David is even more remarkable when contrasted with Saul’s bitter contempt. Although at first Saul rewarded David for killing Goliath, his jealousies and insecurities became apparent as word of Israel’s newest hero spread. Saul heard the Israelite women singing, ‘Saul hath slain his thousands, and David his ten thousands’ (1 Samuel 18:7). Out of jealousy, Saul tried to kill David with a javelin—the first of his many attempts to take David’s life.”

(“Lessons from the Old Testament: True Friendship and Self-Respect,” Ensign, June 2006, 30.)