Allaah says (interpretation of the meaning):
"And proclaim to mankind the Hajj (pilgrimage). They will come to you on foot and on every lean camel, they will come from every deep and distant (wide) mountain highway (to perform Hajj)" [al-Hajj 22:27]
Ibn Katheer says in his commentary on this verse (3/221):
This means: Proclaim (O Ibraaheem) the Hajj to the people, calling them to come on pilgrimage to this House which We have commanded you to build. It was mentioned that he said, "O Lord, how can I proclaim it to the people when my voice does not reach them?" He said, "Call and We will convey it." So he stood in his maqaam (station) - or it was said, on the rock, or on al-Safa, or on Abu Qubays (a mountain) - and said: "O people, your Lord has taken a House, so come to it on pilgrimage." And it was said that the mountains lowered themselves so that his voice could reach all parts of the earth and those who were still in the wombs or in men's loins also heard, and everything that heard him, cities, nomad encampments and trees, and everyone whom Allaah has decreed should perform Hajj until the Day of Resurrection responded, (saying) Labbayk Allaahumma labbayk (Here I am, O Allaah, here I am. This is the summary of what was narrated from Ibn 'Abbaas, Mujaahid, 'Ikrimah, Sa'eed ibn Jubayr and others among the salaf. And Allaah knows best.
Ibn al-Jawzi, in his book Mutheer al-'Azm al-Saakin (1/354) narrated something similar, but more briefly, and he attributed it to the narrators of Seerah.
This has to do with the history of the enjoining of Hajj before the sending of the Prophet (peace and blessings of Allaah be upon him). With regard to the enjoining of Hajj in Islam, there is some scholarly difference of opinion concerning that. It was said that it was enjoined in 6 AH, or in 7 AH, or in 9 AH, or in 10 AH. Imam Ibn al-Qayyim (may Allaah have mercy on him) was certain that it was enjoined in 9 or 10 AH. He (may Allaah have mercy on him) said in Zaad al-Ma'aad:
"There is no dispute that the Prophet (peace and blessings of Allaah be upon him) did not perform Hajj after he migrated to Madeenah apart from one Hajj, which was the Farewell Pilgrimage. And there is no dispute that that occurred in 10 AH… When the command to perform Hajj was revealed, the Messenger of Allaah (peace and blessings of Allaah be upon him) hastened to perform Hajj with no delay. Because the enjoining of Hajj came at a later stage, in 9 or 10 AH, one might say, How can you prove that the command to perform Hajj was delayed until 9 or 10 AH? We would say that the first part of Soorah Aal 'Imraan was revealed in the year of delegations ('aam al-wufood), during which the delegation from Najraan came to the Messenger of Allaah (peace and blessings of Allaah be upon him) and he made a treaty with them regarding their paying the jizyah, and the (ruling on) jizyah was revealed in the year of Tabook, 9 AH, when the first part of Soorat Aal 'Imraan was revealed…"
Al-Qurtubi said in his Tafseer (2/4/92): Hajj was known to the Arabs. When Islam came, they were told about something they already knew and what was enjoined upon them was something they were familiar with…" See also Ahkaam al-Qur'aan by Ibn al-'Arabi, 1/286.