Quran

Al-An'am 6:84

The Cattle · Juz 7

وَوَهَبْنَا لَهُۥٓ إِسْحَـٰقَ وَيَعْقُوبَ ۚ كُلًّا هَدَيْنَا ۚ وَنُوحًا هَدَيْنَا مِن قَبْلُ ۖ وَمِن ذُرِّيَّتِهِۦ دَاوُۥدَ وَسُلَيْمَـٰنَ وَأَيُّوبَ وَيُوسُفَ وَمُوسَىٰ وَهَـٰرُونَ ۚ وَكَذَٰلِكَ نَجْزِى ٱلْمُحْسِنِينَ

And We gave to him [i.e., Abraham] Isaac and Jacob - all [of them] We guided. And Noah, We guided before; and among his descendants, David and Solomon and Job and Joseph and Moses and Aaron. Thus do We reward the doers of good.

Saheeh International

Part of Prophets Guided by Allah (6:84–90)
Sunnah · quoting this verse

Narrated Al-Awwam:I asked Mujahid regarding the prostration in Surat Sa`d. He said, "I asked Ibn `Abbas, 'What evidence makes you prostrate?' He said, "Don't you recite:--'And among his progeny, David and Solomon..(6.84). Those are they whom Allah had guided. So follow their guidance.' (6.90) So David was the one of those prophets whom Prophet (Muhammad) was ordered to follow. David prostrated, so Allah's Messenger (ﷺ) (Muhammad) performed this prostration too

Quotes6:846:90