The Messenger of Allah, peace be upon him, forbade people to leave or enter a land where there is a plague, in order to check the spread of the contagious disease and confine it to a limited area. In medical terminology this is known as “quarantine.” Usamah ibn Zaid said: “The Prophet, peace be upon him, remarked in reference to the plague, ‘It is a remnant of the chastisement inflicted upon the Israelites. If a plague breaks out in a place where you are, do not leave that place, and when you hear of its spread in another place, do not go there.” (Narrated by Tirmizhi, who considers it a sound hadith)
Ibn ‘Abbas reports: “‘Umar ibn al-Khattab went to Al-Sham (Syria). When he reached Sargh, the army commanders, Abu Obaidah ibn al-Jarrah, and others received him. They informed him that a plague had broken out in Al-Sham.”Ibn Abbas continued, “‘Umar assembled the leaders from among the Muhajirin and sought their opinions. They offered conflicting opinions. Some said: ‘We have come for a certain objective, and so we should not turn back from it.’ Others said: ‘With you are others, including some companions of the Messenger of Allah, peace be upon him. We do not believe that you should expose them to this plague.’ ‘Umar said: ‘You may leave. ‘Then he gathered together the Ansar and asked their opinion. They were unanimous in their advice to him. They said: ‘We believe that you should return with the people and you should not expose them to the plague.’ Then ‘Umar addressed the people, announced that he was going back the next morning, and asked them to be prepared to leave in the morning.’ At this Abu Ubaidah ibn al-Jarrah said: ‘O ‘Umar! Are you running away from the decree of Allah!’ ‘Umar replied: ‘O Abu Ubaidah! I wish someone else had said this. Yes, we do run from the decree of Allah to the decree of Allah. What if you had a herd of camels and you took them to a valley that had two slopes, one green pasturage and the other dry and barren. Would you not be fulfilling the decree of Allah if you let your herd graze on the green pasture rather than keeping them on the dry barren land?’ Just then came Abdurrahman ibn ‘Awf. He had been away on some errand. He said: ‘I have some knowledge concerning this issue. I heard the Messenger of Allah, peace be upon him, say: “If you hear that an epidemic has broken out in a land, do not approach it. If it attacks a land where you live, then do not leave that land in a bid to escape from it”.’ Hearing this ‘Umar praised Allah and then he departed. This is reported by Bukhari.