When the pilgrim wishes to leave Mecca and return to his homeland—or anywhere else—he must not depart until he has performed the Farewell Circumambulation (ṭawāf al-wadāʿ) of the Kaʿbah, making seven circuits after finishing all his other affairs and when nothing remains but to mount and set out, so that his last act in the Sacred Precinct is that ṭawāf. The only exception is a menstruating woman: no farewell ṭawāf is required of her, and she may travel without it.
Ibn ʿAbbās (Allah be pleased with him) reported: “The people were commanded to make their final act at the House the ṭawāf, except that a concession was granted to the menstruating woman.” Agreed upon. In another narration he said: “People used to leave from every direction, so the Prophet ﷺ said, ‘No one should depart until his last act is at the House.’” Reported by Aḥmad, Muslim, Abū Dāwūd, and Ibn Mājah.
Ibn ʿAbbās also narrated that the Prophet ﷺ “permitted the menstruating woman to set out before performing the ṭawāf of the House if she had already completed the ṭawāf al-ifāḍah.” Reported by Aḥmad.
ʿĀʾishah (Allah be pleased with her) said: “Safiyyah bint Ḥuyayy began her period after she had performed the ṭawāf al-ifāḍah. I mentioned this to the Messenger of Allah ﷺ, and he said, ‘Is she going to detain us?’ I replied, ‘O Messenger of Allah, she has already performed the ṭawāf al-ifāḍah and then her menses began.’ He said, ‘Then let her depart.’” Agreed upon.