He traced it back to the Prophet ﷺ, who said, "Allah never destroyed a people with a punishment from the sky or from the earth except before Musa." Then he recited, "And We did indeed give Musa the Scripture after We had destroyed the earlier generations" [Qasas 28:43].
رفعه إلى النبي ﷺ قال: ما أهلك الله تبارك وتعالى قوما بعذاب من السماء ولا من الأرض إلا قبل موسى، ثم قال: {ولقد آتينا موسى الكتاب من بعد ما أهلكنا القرون الأولى}.
No references are available.
Bazzar narrated it in Kashf Astar (2248) from Nasr bin Ali, our informant was Abdul-Ala, who said, Awf narrated to us, from Abu Nadra, from Abu Saeed Khudri, who then related it. Its isnad is sahih. Awf here is Ibn Abu Jameela Abdi. It has also been narrated with the chain stopping at the companion, but the version tracing it back to the Prophet is the more correct one.As for the previous nations that Allah Almighty destroyed before giving Musa the Torah, they are as follows.First, the people of Nuh
. Allah Almighty said, "And We certainly sent Nuh to his people, and he remained among them a thousand years minus fifty years, and the flood seized them while they were wrongdoers" [Ankabut 29:14].Second, Aad, the people of Hud
. Allah Almighty said, "And as for Aad, they were destroyed by a screeching, violent wind, which He imposed upon them for seven nights and eight days in succession, so you would see the people therein fallen as if they were trunks of hollow palm trees" [Haqqah 69:6–7].Third, Thamud, the people of Salih
. Allah Almighty said, "And as for Thamud, they were destroyed by the overwhelming blast" [Haqqah 69:5].Fourth, the people of Lut
. Allah Almighty said, "So We saved him and his family, all of them, except an old woman among those who remained behind. Then We destroyed the others. And We rained upon them a rain, and how evil was the rain of those who were warned" [Shuara 26:170–173].Fifth, the people of Shuayb
. Allah Almighty said, "So the earthquake seized them, and they became corpses fallen in their homes. Those who denied Shuayb, it was as if they had never lived there. Those who denied Shuayb, it was they who were the losers" [Araf 7:91–92].Sixth, Pharaoh and his soldiers. Allah Almighty said, "And when We parted the sea for you and saved you and drowned the people of Pharaoh while you were looking on" [Baqarah 2:50].All of these were destroyed before the Torah was revealed to Musa
, and that is why Allah Almighty said, "And We certainly gave Musa the Scripture after We had destroyed the former generations, as insight for the people, and guidance and mercy, that they might remember" [Qasas 28:43].