قَالَ لَقَدْ ظَلَمَكَ بِسُؤَالِ نَعْجَتِكَ إِلَىٰ نِعَاجِهِۦ ۖ وَإِنَّ كَثِيرًا مِّنَ ٱلْخُلَطَآءِ لَيَبْغِى بَعْضُهُمْ عَلَىٰ بَعْضٍ إِلَّا ٱلَّذِينَ ءَامَنُوا۟ وَعَمِلُوا۟ ٱلصَّـٰلِحَـٰتِ وَقَلِيلٌ مَّا هُمْ ۗ وَظَنَّ دَاوُۥدُ أَنَّمَا فَتَنَّـٰهُ فَٱسْتَغْفَرَ رَبَّهُۥ وَخَرَّ رَاكِعًا وَأَنَابَ ۩
Dawood said: "He has certainly wronged you in seeking to add your ewe to his flock: in fact many partners are unjust to one another; except those who believe and do good deeds, and they are few indeed." - While he said this, Dawood realized that We had tested him ( Dawood had shown desire to one of his officers to divorce his wife so that he could marry her even though he already had 99 wives). So he sought forgiveness of his Rabb and fell down on his knees and turned to Allah in repentance.