Usama bin Zayd reported,

The Prophet ﷺ mentioned the plague and said, "It is the remnant of a punishment or torment sent upon a group of the Children of Israil. So if it breaks out in a land while you are there, do not leave it, and if it breaks out in a land while you are not there, do not enter it."

Tirmidhi 1065

Sahih

حدثنا قتيبة حدثنا حماد بن زيد عن عمرو بن دينار عن عامر بن سعد

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

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

الترمذي 1065صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami Tirmidhi
Book
Funerals
Chapter
Dislike of fleeing from plague
Numbering
Darussalam 1065
Tirmidhi 1065