كتاب السلام
39  
The Book of Greetings
(32)
Chapter: The Plague, Ill Omens, Soothsaying And The Like
(32)
باب الطَّاعُونِ وَالطِّيَرَةِ وَالْكَهَانَةِ وَنَحْوِهَا ‏‏
Sahih Muslim 2218 f

Usama b. Zaid reported Allah's Messenger (ﷺ) having said this:

This calamity or illness was a punishment with which were punished some of the nations before you. Then it was left upon the earth. It goes away once and comes back again. He who heard of its presence in a land should not go towards it, and he who happened to be in a land where it had broken out should not fly from it.
حَدَّثَنِي أَبُو الطَّاهِرِ، أَحْمَدُ بْنُ عَمْرٍو وَحَرْمَلَةُ بْنُ يَحْيَى قَالاَ أَخْبَرَنَا ابْنُ وَهْبٍ، أَخْبَرَنِي يُونُسُ، عَنِ ابْنِ شِهَابٍ، أَخْبَرَنِي عَامِرُ بْنُ سَعْدٍ، عَنْ أُسَامَةَ بْنِ زَيْدٍ، عَنْ رَسُولِ اللَّهِ صلى الله عليه وسلم أَنَّهُ قَالَ ‏ "‏ إِنَّ هَذَا الْوَجَعَ أَوِ السَّقَمَ رِجْزٌ عُذِّبَ بِهِ بَعْضُ الأُمَمِ قَبْلَكُمْ ثُمَّ بَقِيَ بَعْدُ بِالأَرْضِ فَيَذْهَبُ الْمَرَّةَ وَيَأْتِي الأُخْرَى فَمَنْ سَمِعَ بِهِ بِأَرْضٍ فَلاَ يَقْدَمَنَّ عَلَيْهِ وَمَنْ وَقَعَ بِأَرْضٍ وَهُوَ بِهَا فَلاَ يُخْرِجَنَّهُ الْفِرَارُ مِنْهُ ‏"‏ ‏.‏
Reference : Sahih Muslim 2218f
In-book reference : Book 39, Hadith 129
USC-MSA web (English) reference : Book 26, Hadith 5498
  (deprecated numbering scheme)