Sunan Abi Dawud, Hadith 4598

Khalid al-Hadhdha, asked al-Hasan about the Quranic verse: “And for this did He create them.” He said: He created these for this and those for that.

حَدَّثَنَا مُوسَى بْنُ إِسْمَاعِيلَ، حَدَّثَنَا حَمَّادٌ، حَدَّثَنَا خَالِدٌ الْحَذَّاءُ، عَنِ الْحَسَنِ، فِي قَوْلِهِ تَعَالَى ‏{‏ وَلِذَلِكَ خَلَقَهُمْ ‏}‏ قَالَ خَلَقَ هَؤُلاَءِ لِهَذِهِ وَهَؤُلاَءِ لِهَذِهِ ‏.‏

sunnah.com

also referenced under: Hadith 4615 (DarusSalam)