Jami` at-Tirmidhi, Book 47, Hadith 3229 (In-Book)

Narrated 'Asim Al-Ahwal: "I asked Anas bin Malik about As-Safa and Al-Marwah, and he said: 'They were among the rites of Jahiliyyah.' He said: 'So during Islam, we refrained from them, then Allah, Blessed and Most High, revealed: Indeed As-Safa and Al-Marwah are of the symbols of Allah. So it is not a sin for those who perform Hajj or 'Umrah to the house to go between them. (2:158)' He said: 'So it is voluntarily then verily, Allah is the All-Recogniser, the All-Knowing. (2:158)'"

حَدَّثَنَا عَبْدُ بْنُ حُمَيْدٍ، حَدَّثَنَا يَزِيدُ بْنُ أَبِي حَكِيمٍ، عَنْ سُفْيَانَ، عَنْ عَاصِمٍ الأَحْوَلِ، قَالَ سَأَلْتُ أَنَسَ بْنَ مَالِكٍ عَنِ الصَّفَا، وَالْمَرْوَةِ، فَقَالَ كَانَا مِنْ شَعَائِرِ الْجَاهِلِيَّةِ فَلَمَّا كَانَ الإِسْلاَمُ أَمْسَكْنَا عَنْهُمَا فَأَنْزَلَ اللَّهُ ‏:‏ ‏(‏ إِنَّ الصَّفَا وَالْمَرْوَةَ مِنْ شَعَائِرِ اللَّهِ فَمَنْ حَجَّ الْبَيْتَ أَوِ اعْتَمَرَ فَلاَ جُنَاحَ عَلَيْهِ أَنْ يَطَّوَّفَ بِهِمَا ‏)‏ قَالَ هُمَا تَطَوُّعٌ ‏(‏فَمَنْ تَطَوَّعَ خَيْرًا فَإِنَّ اللَّهَ شَاكِرٌ عَلِيمٌ ‏)‏ ‏.‏ قَالَ أَبُو عِيسَى هَذَا حَدِيثٌ حَسَنٌ صَحِيحٌ ‏.‏

sunnah.com