Be patient in the face of their utterances, and remember our servant David, the resourceful; he was obedient.

David was a prophet and king of the Children of Israel. God gave him a scripture, the Psalms (4:163, 17:55), and he was sent to his own people, Israel. The disbelievers among them were condemned "by the tongue of David and Jesus, the son of Mary," because they disobeyed and transgressed (5:78). The Quran calls him "our servant David, the resourceful; he was obedient" (38:17).
His story begins in the generation after Moses. The leaders of Israel asked their prophet for a king so they could fight in God's cause. God appointed Saul, and they objected that he was not rich, but God had blessed him with "an abundance in knowledge and in body" (2:246-248). Saul tested his troops with a stream, and most of them failed. The few who were left felt too weak to face Goliath. Those who were conscious of meeting God answered: "Many a small army defeated a large army by GOD's leave" (2:249). They prayed for steadfastness, and they won by God's leave: "David killed Goliath. GOD gave him kingship and wisdom, and taught him as He willed" (2:250-251).
As king, David received unusual blessings. God made the mountains and the birds glorify Him together with David (38:18-19, 21:79). He softened iron for David and taught him to make shields that fit perfectly, to protect people in war (34:10-11, 21:80). God strengthened his kingship and gave him "wisdom and good logic" (38:20). God also gave him knowledge, and he praised God for it (27:15). David and Solomon once judged a case in which one man's sheep had destroyed another man's crop. God gave Solomon the correct understanding, though He had given both of them wisdom and knowledge (21:78-79).
The best-known test of his judgment came when two feuding men slipped into his sanctuary. One owned ninety-nine sheep and kept pressing his brother to merge in his one sheep. David ruled that this was unfair. Afterwards he wondered whether he had judged rightly, realized God was testing him, and asked for forgiveness, bowed down, and repented. God forgave him and granted him "a position of honor with us, and a beautiful abode" (38:21-25). Dr. Khalifa remarks in his footnote that even with a case this clear, 99 on one side and 1 on the other, David's extreme care to judge correctly made him ask forgiveness, and he asks the reader: "Are we this careful?" God then told him to judge among the people equitably and not follow his personal opinion (38:26). God gave him Solomon, "a good and obedient servant," who became his heir (38:30, 27:16).
The Quran draws several lessons from his life. Victory comes by God's leave, not by numbers, and God supports some people against others so the earth is not overrun by chaos (2:249-251). Blessings call for gratitude: "O family of David, work (righteousness) to show your appreciation. Only a few of My servants are appreciative" (34:13). Authority brings a duty to be fair and to keep personal opinion out of judgment, because those who stray from God's way forget the Day of Reckoning (38:26). And David himself shows that the remedy for a possible mistake is immediate repentance. The Quran presents him to Muhammad as an example of patience in the face of what people say (38:17).
Verses
SubmissionAI can make mistakes. Check the sources.
Be patient in the face of their utterances, and remember our servant David, the resourceful; he was obedient.
We committed the mountains in his service, glorifying with him night and day.
Also the birds were committed to serve him; all were obedient to him.
We strengthened his kingship, and endowed him with wisdom and good logic.
Have you received news of the feuding men who sneaked into his sanctuary?
When they entered his room, he was startled. They said, "Have no fear. We are feuding with one another, and we are seeking your fair judgment. Do not wrong us, and guide us in the right path.
"This brother of mine owns ninety-nine* sheep, while I own one sheep. He wants to mix my sheep with his, and continues to pressure me."
*38:23 This is the only place where the number 99 occurs. Thirty different numbers are mentioned in the Quran, and their total comes to 162146, 19x8534. See Appendix 1.
He said, "He is being unfair to you by asking to combine your sheep with his. Most people who combine their properties treat each other unfairly, except those who believe and work righteousness, and these are so few." Afterwards, David wondered if he made the right judgment. He thought that we were testing him. He then implored his Lord for forgiveness, bowed down, and repented.*
*38:24 In this clear example, 99 on one side vs 1 on the other side, David's extreme care to render the correct judgment caused him to ask forgiveness. Are we this careful?
We forgave him in this matter. We have granted him a position of honor with us, and a beautiful abode.
O David, we have made you a ruler on earth. Therefore, you shall judge among the people equitably, and do not follow your personal opinion, lest it diverts you from the way of GOD. Surely, those who stray off the way of GOD incur severe retribution for forgetting the Day of Reckoning.
We did not create the heaven and the earth, and everything between them, in vain. Such is the thinking of those who disbelieve. Therefore, woe to those who disbelieve; they will suffer in Hell.
Shall we treat those who believe and lead a righteous life as we treat those who commit evil on earth? Shall we treat the righteous as we treat the wicked?
This is a scripture that we sent down to you, that is sacred—perhaps they reflect on its verses. Those who possess intelligence will take heed.
To David we granted Solomon; a good and obedient servant.