Ikrimah (may Allah have mercy on him) said that Sayyiduna Zayd bin Thabit (may Allah be pleased with him) said: "She should stay until she becomes pure, and her last act should be at the House (of Allah)." Then Sayyiduna Ibn Abbas (may Allah be pleased with him) said: "If she has already performed the circumambulation (tawaf) on the Day of Sacrifice, then she may depart." So Sayyiduna Zayd bin Thabit (may Allah be pleased with him) sent a message to Sayyiduna Ibn Abbas (may Allah be pleased with him): "I have found what you said to be just as you said." Then Sayyiduna Ibn Abbas (may Allah be pleased with him) said: "I know the saying of the Messenger of Allah (peace and blessings be upon him) concerning women, but I wanted to speak according to the Book of Allah." Then he recited this verse: "Then let them end their untidiness, fulfil their vows and circumambulate the Ancient House" [Surah al-Hajj: 29]. "She has removed her untidiness, fulfilled her vow and circumambulated the House, so what remains?"
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الحج / 9762