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)
Hadith Referenceصحيح البخاري / كتاب تفسير القرآن / 4496
Hadith Gradingمحدثین:أحاديث صحيح البخاريّ كلّها صحيحة
Hadith Commentary: When the Sacred Mosque (Masjid al-Haram) was appointed as the qiblah, there were many misconceptions among the people regarding Safa and Marwah, the details of which have already been mentioned in the benefits of the previous hadith. In this noble verse, those misconceptions have been addressed: performing sa’i (ritual walking) between these two places is among the essential rites of Hajj, and the sanctity of these places is from Allah. It has no connection whatsoever with the baseless innovations of the people of ignorance (Jahiliyyah).
Source: Hidayat al-Qari: Commentary on Sahih Bukhari, Urdu, Page: 4496