It is narrated from Sayyiduna al-Muttalib bin Abi Wada'ah (may Allah be pleased with him) that the Prophet (peace and blessings be upon him) came out of the Ka'bah, then stood facing the corner and prayed two rak'ahs, while people, men and women, were passing in front of him as they performed tawaf of the House.
Hadith Referenceالمعجم الكبير للطبراني / باب الميم / 17818