Mishkat al-Masabih 1548
وَعَنْ أُسَامَةَ بْنِ زَيْدٍ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «الطَّاعُونُ رِجْزٌ أُرْسِلَ عَلَى طَائِفَةٍ مِنْ بَنِي إِسْرَائِيلَ أَوْ عَلَى مَنْ كَانَ قَبْلَكُمْ فَإِذَا سَمِعْتُمْ بِهِ بِأَرْضٍ فَلَا تَقْدَمُوا عَلَيْهِ وَإِذَا وَقَعَ بِأَرْضٍ وَأَنْتُمْ بِهَا فَلَا تَخْرُجُوا فِرَارًا مِنْهُ»
From Usamah ibn Zayd, who said: The Messenger of Allah ﷺ said: "The plague is a punishment that was sent upon a group of the Children of Israʾil, or upon those before you. So when you hear of it in a land, do not go to it; and when it breaks out in a land while you are in it, do not leave fleeing from it."