Sahih al-Bukhari, Hadith 4496

Narrated `Asim bin Sulaiman: I asked Anas bin Malik about Safa and Marwa. Anas replied, "We used to consider (i.e. going around) them a custom of the Pre-islamic period of Ignorance, so when Islam came, we gave up going around them. Then Allah revealed" "Verily, Safa and Marwa (i.e. two mountains at Mecca) are among the Symbols of Allah. So it is not harmful of those who perform the Hajj of the House (of Allah) or perform the Umra to ambulate (Tawaf) between them." (2.158)

حَدَّثَنَا مُحَمَّدُ بْنُ يُوسُفَ، حَدَّثَنَا سُفْيَانُ، عَنْ عَاصِمِ بْنِ سُلَيْمَانَ، قَالَ سَأَلْتُ أَنَسَ بْنَ مَالِكٍ ـ رضى الله عنه ـ عَنِ الصَّفَا، وَالْمَرْوَةِ،‏.‏ فَقَالَ كُنَّا نَرَى أَنَّهُمَا مِنْ أَمْرِ الْجَاهِلِيَّةِ، فَلَمَّا كَانَ الإِسْلاَمُ أَمْسَكْنَا عَنْهُمَا، فَأَنْزَلَ اللَّهُ تَعَالَى ‏{‏إِنَّ الصَّفَا وَالْمَرْوَةَ ‏}‏ إِلَى قَوْلِهِ ‏{‏أَنْ يَطَّوَّفَ بِهِمَا‏}‏‏.‏

sunnah.com