Moon worship has been practiced in Arabia since 2000 BC. The crescent moon is the most common symbol of this pagan moon worship as far back as 2000 BC.
In Mecca, there was a god named Hubal who was Lord of the Kabah.
This Hubal was a moon god.
One Muslim apologist confessed that the idol of moon god Hubal was placed upon the roof of the Kaba about 400 years before Muhammad. This may in fact be the origin of why the crescent moon is on top of every minaret at the Kaba today and the central symbol of Islam atop of every mosque throughout the world:
About four hundred years before the birth of Muhammad one Amr bin Lahyo … a descendant of Qahtan and king of Hijaz, had put an idol called Hubal on the roof of the Kaba. This was one of the chief deities of the Quraish before Islam. (Muhammad The Holy Prophet, Hafiz Ghulam Sarwar (Pakistan), p 18-19, Muslim)
The moon god was also referred to as “al-ilah”. This is not a proper name of a single specific god, but a generic reference meaning “the god”. Each local pagan Arab tribe would refer to their own local tribal pagan god as “al-ilah”.
“al-ilah” was later shortened to Allah before Muhammad began promoting his new religion in 610 AD.
There is evidence that Hubal was referred to as “Allah”.
When Muhammad came along, he dropped all references to the name “Hubal” but retained the generic “Allah”.
Muhammad retained almost all the pagan rituals of the Arabs at the Kaba and redefined them in monotheistic terms.
Regardless of the specifics of the facts, it is clear that Islam is derived from paganism that once worshiped a moon-god.
Although Islam is today a monotheist religion, its roots are in paganism.
Credits – http://www.sodahead.com