It is narrated from Sayyiduna Ibn Abbas (may Allah be pleased with them both) that people were instructed on behalf of the Noble Prophet (peace and blessings of Allah be upon him) that their last act (before leaving Makkah) should be with the Ka'bah (i.e., they should perform Tawaf of the Ka'bah before departing), but this was excused for a menstruating woman.
Sayyiduna Anas bin Malik (may Allah be pleased with him) narrates that the Prophet Muhammad (peace and blessings be upon him) offered the Zuhr, Asr, Maghrib, and Isha prayers at (the place of) Muhassab, then rested for a short while. After that, he rode towards the Ka'bah and performed its Tawaf.