Surah Al-An'aam

6:131

ذَٰلِكَ أَن لَّمْ يَكُن رَّبُّكَ مُهْلِكَ ٱلْقُرَىٰ بِظُلْمٍۢ وَأَهْلُهَا غَٰفِلُونَ

Yang demikian (kedatangan Rasul-rasul itu ialah), kerana Tuhanmu tidak membinasakan negeri-negeri secara zalim sedang penduduknya leka lalai.

Tafsir 6:131

The reason for sending messengers to mankind and jinn is so that no one is punished for the crimes they committed without a messenger having been sent to warn them and the invitation reaching them. I only punished a nation after sending messengers to them.