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)
كُنَّا نَرَى أَنَّهُمَا مِنْ أَمْرِ الْجَاهِلِيَّةِ فَلَمَّا كَانَ الإِسْلاَمُ أَمْسَكْنَا عَنْهُمَا فَأَنْزَلَ اللَّهُ تَعَالَى {إِنَّ الصَّفَا وَالْمَرْوَةَ } إِلَى قَوْلِهِ {أَنْ يَطَّوَّفَ بِهِمَا}