Usama bin Zayd reported,

The Messenger of Allah ﷺ said, "The plague is a sign of divine punishment with which Allah عز وجل has tested some of His servants. So when you hear of it, do not enter the land where it has appeared, and when it strikes a land while you are in it, do not flee from it."This is the wording of Qanabi's narration, and Qutayba's is similar.

Muslim 5773

Sahih

حدثنا عبد الله بن مسلمة بن قعنب وقتيبة بن سعيد قالا أخبرنا المغيرة ونسبه ابن قعنب فقال ابن عبد الرحمن القرشي عن أبي النضر عن عامر بن سعد بن أبي وقاص

عن أسامة بن زيد قال

قال رسول الله ﷺ الطاعون آية الرجز ابتلى الله عز وجل به ناسا من عباده فإذا سمعتم به فلا تدخلوا عليه وإذا وقع بأرض وأنتم بها فلا تفروا منه هذا حديث القعنبي وقتيبة نحوه

مسلم 5773صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Peace
Chapter
Plague, superstitious belief in omens, soothsaying, and similar matters
Numbering
Darussalam 5773
Muslim 5773