Abdullah ibn Abi Mulaykah reported: Aisha, may Allah be pleased with her, returned one day from the graveyard. I said, “O mother of the believers, from where have you returned?” Aisha said, “From the grave of my brother, Abdur Rahman ibn Abi Bakr.” I said, “Did not the Messenger of Allah, peace and blessings be upon him, prohibit you women from visiting graves?” Aisha said, “Yes, he prohibited us at first, but then he commanded us to visit them.”
Source: al-Sunan al-Kubrá 6659
Grade: Sahih (authentic) according to Al-Albani
عَنْ عَبْدِ اللَّهِ بْنِ أَبِي مُلَيْكَةَ أَنَّ عَائِشَةَ رَضِيَ اللَّهُ عَنْهَا أَقْبَلَتْ ذَاتَ يَوْمٍ مِنَ الْمَقَابِرِ فَقُلْتُ لَهَا يَا أُمَّ الْمُؤْمِنِينَ مِنْ أَيْنَ أَقْبَلْتِ قَالَتْ مِنْ قَبْرِ أَخِي عَبْدِ الرَّحْمَنِ بْنِ أَبِي بَكْرٍ فَقُلْتُ لَهَا أَلَيْسَ كَانَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ نَهَى عَنْ زِيَارَةِ الْقُبُورِ قَالَتْ نَعَمْ كَانَ نَهَى ثُمَّ أَمَرَ بِزِيَارَتِهَا
6659 السنن الكبرى للبيهقي كتاب الجمعة جماع أبواب حمل الجنازة باب ما ورد في نهي النساء عن اتباع
230 المحدث الألباني خلاصة حكم المحدث إسناده صحيح رجاله ثقات في أحكام الجنائز