Early history (up to 6th century CE)
The early history of Mecca is still largely shrouded by a lack of clear sources. The city lies in the hinterland of the middle part of western Arabia of which there are sparse textual or archaeological sources available. This lack of knowledge is in contrast to both the northern and southern areas of western Arabia, specifically the Syro-Palestinian frontier and Yemen, where historians have various sources available such as physical remains of shrines, inscriptions, observations by Greco-Roman authors, and information collected by church historians. The area of the Hejaz that surrounds Mecca was characterized by its remote, rocky, and inhospitable nature, supporting only meagre settled populations in scattered oases and occasional stretches of fertile land. The Red Sea coast offered no easily accessible ports and the oasis dwellers and bedouins in the region were illiterate.
One study by Majied Robinson, based on early Islamic genealogical records, estimates that at the time of Muhammad the population of Mecca was around 550. Muslim scholars using traditional sources may place the number as high as 10,000.
The first clear reference to Mecca in non-Islamic literature appears in 741, long after the death of Muhammad, in the Byzantine-Arab Chronicle or Chronicle of 741. However, English writer Tom Holland claims that here the author places the region in Mesopotamia rather than the Hejaz.
Possible earlier mentions are ambiguous. The Greek historian Diodorus Siculus writes about Arabia in the 1st century BCE in his work Bibliotheca Historica, describing a holy shrine: "And a temple has been set up there, which is very holy and exceedingly revered by all Arabians." Claims have been made this could be a reference to the Kaaba in Mecca. However, the geographic location Diodorus describes is located in northwest Arabia, around the area of Leuke Kome, within the former Nabataean Kingdom and the Roman province of Arabia Petraea.
Ptolemy lists the names of 50 cities in Arabia, one going by the name of Macoraba. There has been speculation since 1646 that this could be a reference to Mecca. Historically, there has been a general consensus in scholarship that Macoraba mentioned by Ptolemy in the 2nd century CE is indeed Mecca, but more recently, this has been questioned. Historian Glen Bowersock favors the identity of the former, with his theory being that "Macoraba" is the word "Makkah" followed by the aggrandizing Aramaic adjective rabb (great). The Roman 4th-century historian Ammianus Marcellinus also enumerated many cities of Western Arabia, most of which can be identified. According to Bowersock, he did mention Mecca as "Geapolis" or "Hierapolis," the latter one meaning "holy city" potentially referring to the sanctuary of the Kaaba. Danish writer Patricia Crone, from the Revisionist school of Islamic studies on the other hand, writes that "the plain truth is that the name Macoraba has nothing to do with that of Mecca [...] if Ptolemy mentions Mecca at all, he calls it Moka, a town in Arabia Petraea."
Procopius' 6th century statement that the Ma'add tribe possessed the coast of western Arabia between the Ghassanids and the Himyarites of the south supports the Arabic sources tradition that associates Quraysh as a branch of the Ma'add and Muhammad as a direct descendant of Ma'add ibn Adnan.
Patricia Crone and Tom Holland has cast doubt on the claim that Mecca was a major historical trading outpost. However, other scholars such as Glen W. Bowersock disagree and assert that Mecca was a major trading outpost. Crone later on disregarded some of her theories. She argues that Meccan trade relied on skins, hides, manufactured leather goods, clarified butter, Hijazi woollens, and camels. She suggests that most of these goods were destined for the Roman army, which is known to have required colossal quantities of leather and hides for its equipment. The earliest Muslim inscriptions are from the Mecca–Taif area.
Islamic narrative
In the Islamic view, the beginnings of Mecca are attributed to the Biblical figures, Adam, Abraham, Hagar and Ishmael. It was Adam himself who built the first God's house in Mecca according to a heavenly prototype but this building was destroyed in the Noahic Flood. The civilization of Mecca is believed to have started after Ibrāhīm (Abraham) left his son Ismāʿīl (Ishmael) and wife Hājar (Hagar) in the valley at Allah's command. Some people from the Yemeni tribe of Jurhum settled with them, and Isma'il reportedly married two women, one after divorcing the first, on Ibrahim's advice. At least one man of the Jurhum helped Ismāʿīl and his father to construct or according to Islamic narratives, reconstruct, the Kaaba ('Cube'), which would have social, religious, political and historical implications for the site and region.
Muslims see the mention of a pilgrimage at the Valley of the Bakha in the Old Testament chapter Psalm 84:3–6 as a reference to Mecca, similar to the Quran at Surah 3:96 In the 'āl ʿimrān, a commentary on the Samaritan midrashic chronology of the Patriarchs, of unknown date but probably composed in the 10th century CE, it is claimed that Mecca was built by the sons of Nebaioth, the eldest son of Ismāʿīl or Ishmael.
Sometime in the 5th century, the Ka'bah was a place of worship for the deities of Arabia's pagan tribes. Mecca's most important pagan deity was Hubal, which had been placed there by the ruling Quraysh tribe, and remained until the Conquest of Mecca by Muhammad. In the 5th century, the Quraish took control of Mecca, and became skilled merchants and traders. In the 6th century, they joined the lucrative spice trade, since battles elsewhere were diverting trade routes from dangerous sea routes to more secure overland routes. The Byzantine Empire had previously controlled the Red Sea, but piracy had been increasing. Another previous route that ran through the Persian Gulf via the Tigris and Euphrates rivers was also being threatened by exploitations from the Sasanian Empire, and was being disrupted by the Lakhmid kingdom, the Ghassanids, and the Roman–Persian wars. Mecca's prominence as a trading center also surpassed the cities of Petra and Palmyra. The Sassanids however did not always pose a threat to Mecca, as in 575 they protected it from a Yemeni invasion, led by its Christian leader Abraha. The tribes of southern Arabia asked the Persian king Khosrow I for aid, in response to which he came south to Arabia with foot-soldiers and a fleet of ships near Mecca.
By the middle of the 6th century, there were three major settlements in northern Arabia, all along the south-western coast that borders the Red Sea, in a habitable region between the sea and the Hejaz mountains to the east. Although the area around Mecca was completely barren, it was the wealthiest of the three settlements with abundant water from the renowned Zamzam Well and a position at the crossroads of major caravan routes.
The harsh conditions and terrain of the Arabian peninsula meant a near-constant state of conflict between the local tribes, but once a year they would declare a truce and converge upon Mecca in an annual pilgrimage. Up to the 7th century, this journey was intended for religious reasons by the pagan Arabs to pay homage to their shrine, and to drink Zamzam. However, it was also the time each year that disputes would be arbitrated, debts would be resolved, and trading would occur at Meccan fairs. These annual events gave the tribes a sense of common identity and made Mecca an important focus for the peninsula.
The "Year of the Elephant" is the name in Islamic history for the year approximately equating to 570–572, when, according to Islamic sources such as Ibn Ishaq, Abraha descended upon Mecca, riding an elephant, with a large army after building a cathedral at San'aa, named al-Qullays in honor of the Negus of Axum. It gained widespread fame, even gaining attention from the Byzantine Empire. Abraha attempted to divert the pilgrimage of the Arabs from the Ka'bah to al-Qullays, effectively converting them to Christianity. According to Islamic tradition, this was the year of Muhammad's birth. Abraha allegedly sent a messenger named Muhammad ibn Khuza'i to Mecca and Tihamah with a message that al-Qullays was both much better than other houses of worship and purer, having not been defiled by the housing of idols. When Muhammad ibn Khuza'i got as far as the land of Banu Kinana, the people of the lowland, knowing what he had come for, sent a man of Hudhayl called ʿUrwa bin Hayyad al-Milasi, who shot him with an arrow, killing him. His brother Qays who was with him, fled to Abraha and told him the news, which increased his rage and fury and he swore to raid the Kinana tribe and destroy the Ka'bah. Ibn Ishaq further states that one of the men of the Quraysh tribe was angered by this, and going to Sana'a, entering the church at night and defiling it; widely assumed to have done so by defecating in it.
Abraha marched upon the Kaaba with a large army, which included one or more war elephants, intending to demolish it. When news of the advance of his army came, the Arab tribes of Quraysh, Kinanah, Banu Khuza'ah and Hudhayl united in the defense of the Kaaba and the city. A man from the Himyarite Kingdom was sent by Abraha to advise them that Abraha only wished to demolish the Ka'bah and if they resisted, they would be crushed. Abd al-Muttalib told the Meccans to seek refuge in the hills while he and some members of the Quraysh remained within the precincts of the Kaaba. Abraha sent a dispatch inviting Abdul-Muttalib to meet with Abraha and discuss matters. When Abdul-Muttalib left the meeting he was heard saying: "The Owner of this House is its Defender, and I am sure he will save it from the attack of the adversaries and will not dishonor the servants of His House."
Abraha eventually attacked Mecca. However, the lead elephant, known as Mahmud, is said to have stopped at the boundary around Mecca and refused to enter. It has been theorized that an epidemic such as by smallpox could have caused such a failed invasion of Mecca. The reference to the story in Quran is rather short. According to the 105th Surah of the Quran, Al-Fil, the next day, a dark cloud of small birds sent by Allah appeared. The birds carried small rocks in their beaks, and bombarded the Ethiopian forces, and smashed them to a state like that of eaten straw.
Camel caravans, said to have first been used by Muhammad's great-grandfather, were a major part of Mecca's bustling economy. Alliances were struck between the merchants in Mecca and the local nomadic tribes, who would bring goods – leather, livestock, and metals mined in the local mountains – to Mecca to be loaded on the caravans and carried to cities in Shaam and Iraq. Historical accounts also provide some indication that goods from other continents may also have flowed through Mecca. Goods from Africa and the Far East passed through en route to Syria including spices, leather, medicine, cloth, and slaves; in return Mecca received money, weapons, cereals, and wine, which in turn were distributed throughout Arabia. The Meccans signed treaties with both the Byzantines and the Bedouins, and negotiated safe passages for caravans, giving them water and pasture rights. Mecca became the center of a loose confederation of client tribes, which included those of the Banu Tamim. Other regional powers such as the Abyssinians, Ghassanids, and Lakhmids were in decline leaving Meccan trade to be the primary binding force in Arabia in the late 6th century.