(17) Be patient over what they say and remember Our servant, David, the possessor of strength; indeed, he was one who repeatedly turned back [to Allah].
(18) Indeed, We subjected the mountains [to praise] with him, exalting [Allah] in the [late] afternoon and [after] sunrise.
(19) And the birds were assembled, all with him repeating [praises].
(20) And We strengthened his kingdom and gave him wisdom and discernment in speech.
(21) And has there come to you the news of the adversaries, when they climbed over the wall of [his] prayer chamber -
(22) When they entered upon David and he was alarmed by them? They said, "Fear not. [We are] two adversaries, one of whom has wronged the other, so judge between us with truth and do not exceed [it] and guide us to the sound path.
(23) Indeed this, my brother, has ninety-nine ewes, and I have one ewe; so he said, 'Entrust her to me,' and he overpowered me in speech."
(24) [David] said, "He has certainly wronged you in demanding your ewe [in addition] to his ewes. And indeed, many associates oppress one another, except for those who believe and do righteous deeds - and few are they." And David became certain that We had tried him, and he asked forgiveness of his Lord and fell down bowing [in prostration] and turned in repentance [to Allah].
(25) So We forgave him that; and indeed, for him is nearness to Us and a good place of return.
(26) [We said], "O David, indeed We have made you a successor upon the earth, so judge between the people in truth and do not follow [your own] desire, as it will lead you astray from the way of Allah." Indeed, those who go astray from the way of Allah will have a severe punishment for having forgotten the Day of Account.