Narrated `Urwa
I said to `Aisha, the wife of the Prophet, and I was at that time a young boy, "How do you interpret the Statement of Allah: "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 to the House of Allah) or perform the Umra, to ambulate (Tawaf) between them. In my opinion it is not sinful for one not to ambulate (Tawaf) between them." `Aisha said, "Your interpretation is wrong for as you say, the Verse should have been: "So it is not harmful of those who perform the Hajj or Umra to the House, not to ambulate (Tawaf) between them.' This Verse was revealed in connection with the Ansar who (during the Pre-Islamic Period) used to visit Manat (i.e. an idol) after assuming their Ihram, and it was situated near Qudaid (i.e. a place at Mecca), and they used to regard it sinful to ambulate between Safa and Marwa after embracing Islam. When Islam came, they asked Allah's Messenger (ﷺ) about it, whereupon 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)
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)