Riyad as-Salihin, Book 1, Hadith 439 (In-Book)

Abu Mu sa Al-Ash'ari (May Allah be pleased with him) reported: The Prophet said, "When Allah intends to show mercy to a people, He collects their Prophet before them and makes him a herald to happiness for them in the Hereafter; and when He intends to destroy a people, He punishes them while their Prophet is alive, and destroys them while he is alive and watches them and makes him witness their destruction because they disbelieved in him and disobeyed his commands".[Muslim].

وعن أبي موسى الأشعري، رضي الله عنه ، عن النبي صلى الله عليه وسلم قال‏:‏ ‏ "‏ إذا أراد الله تعالى، رحمة أمةٍ ، قبض نبيها قبلها، فجعله لها فرطاً وسلفاً بين يديها، وإذا أراد هلكة أمةٍ، عذبها ونبيها حي، فأهلكها وهو حى ينظر، فأقر عينه بهلاكها حين كذبوه وعصوا امره‏" ‏ ‏(‏‏(‏رواه مسلم‏)‏‏)‏‏.‏

sunnah.com