Prophet Muhammad discarded the 360 idols but retained for Islam, the Ka’aba with its Black Stone, justifying it with the claim that Abraham and Ishmael originally constructed it. However, there is no historical or archaeological evidence for the existence of the Ka’aba beyond a few hundred years before Muhammad's lifetime. In fact, Muhammad's own words disprove any connection he was attempting to make between Abraham, Ishmael and the Ka’aba.
The Qur'an says Abraham built it:
Muhammed says it was built 40 years prior to the Temple at Jerusalem:
The Temple at Jerusalem was built by Solomon around 958-951 BC. This implies that if Muhammad were to be believed, the Ka’aba must have been built approximately 998-991 BC. But Abraham lived around 2000 BC and both Abraham and Ishmael would have been dead by then.
The Ka’aba has nothing to do with Abraham or Ishmael. It has a wholly pagan heritage. Egyptian Professor and foremost authority on Arabic literature, Dr. Taha Husayn, said the following:
Also, according to sahih hadith, Muhammad even considered dismantling it:
Worship at the Ka’aba and the kissing of the Black Stone are just the first of many practices adopted from 7th century paganism and repackaged within monotheistic Islam.
The pagan gods of pre-Islamic Arabia were worshiped in the form of rectangular stones or rocks. For example, the pagan deity 'Al-Lat', mentioned in Qur'an 53:19, and believed by pre-Islamic pagans to be one of the daughters of Allah, was once venerated as a cubic rock at Ta'if in Saudi Arabia. An edifice was built over the rock to mark it apart as a house of worship.
There is no denying that the Black Stone was one among many stones and idols venerated at the Ka’aba by the pre-Islamic pagans. The Black Stone was kissed during pre-Islamic pagan worship. Though Muhammad threw out 360 other objects at the Ka’aba, he retained this Black Stone and continued the practice of kissing it. It is this same stone that the pre-Islamic pagans once kissed, that Muslims kiss today when visiting Mecca.
Pagans prior to Islam would pray five times per day towards Mecca. Muhammad retained for Islam, this pre-Islamic practice, sanctioning it with a story of a night trip to heaven on a mythical beast called al-Buraq. In heaven, the Hadith tells us that Allah demanded 50 prayers per day per Muslim. Upon advice from Moses, Muhammed bargains with Allah and successfully reduces it to five prayers per day.
Zoroastrians are also expected to recite their (kusti) prayers at least five times a day having first cleansed themselves by washing (ablution). So even today, this is not a practice unique to Islam. But, contrary to the Muslims, they pray in the direction of the Sun (at each time of the day) and/or of the Holy Fire (if they are in a Fire Temple). 
Muhammad's pagan tribe, the Quraish, fasted on the 10th of Muharram. Though optional, Muhammad retained this pagan practice too.
Doing Tawaf between Safa and Marwa is an Islamic ritual associated with the pilgrimage to Mecca. Safa and Marwa are two mounts, located at Mecca. This ritual entails Muslims walking frantically between the two mounts, seven times. This was originally a pagan pre-Islamic practice. Muhammad retained it for Islam, sanctioning it with yet another Qur'anic revelation.
Clearly, the Hadith testifies that Muhammad merely adopted this pagan ceremony from the pre-Islamic "period of ignorance" and justified it with yet another convenient Qur'anic revelation.
A myth was also created about Hagar running between these two mounts in search of water until she found theZamzam Well. Even if this story were true, why is this reason for people to run up and down between two mounts to please a god? This myth was not created to further justify the ritual, but for another reason; Muhammad was trying to market Zamzam, owned by his family, as a money-making venture.
Ihram is a state a Muslim enters into for his pilgrimage to Mecca. It involves a series of procedures like ritual washing, wearing 'Ihram garments', etc. Ihram was originally a pagan requirement for worshipping idols during pre-Islamic times. Muhammad retained this practice for Islam. Muslims assume Ihram to perform the Hajj or Umrah.
Circumambulation is to go in circles around a particular object. In Islam, worshippers and pilgrims do this around the Ka'aba at Mecca. Pre-Islamic pagans used do it to please the moon god Hubal, the 360 deities and Allah (who was merely one among the many deities worshipped there). Muhammad himself used to do it, even before the 360 idols inside the Ka'aba were removed.
Judaism and Christianity (the religions of those who are consideredPeople of the Book) do not practice ritual circumambulation to please God. Two other faiths which do are Hinduism and Buddhism, religions older than Islam and accused by Islam of “paganism” and practicing idolatry.
Hubal was the moon god worshiped at the Ka’aba. The crescent moon was Hubal’s symbol. Muhammad's pagan grandfather Abd al-Muttalib almost slaughtered Muhammad's father Abdallah at the Ka’aba, to Hubal. From Ibn Hisham:
The Ka’aba, Islam's holiest shrine, has been a place where such pagan human sacrifices and slaughters have taken place for Hubal. When Muhammad founded Islam, he discarded Hubal. At the Battle of Badr, his enemy Abu Sufyan praised the high position of moon god Hubal, saying "O Hubal, be high". Muhammad asked his followers to yell back, "Allah is higher".
Is moon-god Hubal no longer "higher"? Is Islam completely free of the 'moon' influence? Take a closer look at mosques all over the world, and you are likely to find Hubal’s symbol, the crescent moon, positioned at a high point of the mosque. As with the Cross for Christianity and the Star of David for Judaism, the Crescent moon is today a universal symbol for Islam.
It may not be a deliberate effort to worship Hubal. And yet, interestingly, through Islam, the pagan prayer of Muhammad's enemy Abu Sufyan at Badr has been answered, "O Hubal be high".