In 628 AD, the Treaty of Hudaybiyyah was drawn up between Muhammad and the Quraysh tribe of Mecca (also the tribe of whom Muhammad was born into). The Quraysh were the dominant tribe living in Mecca both prior to and after Muhammad’s emigration from the city to the agricultural town of Medina where the prophet established his new base and community.
Muhammad and the early Muslims left Mecca after increasing religious and social hostilities between them and the Meccans but despite this the Muslims still had an attachment to the Ka’bah located in the city’s center. Thus, Muhammad with an entourage of followers journeyed to the city as part of the pilgrimage. They approached peacefully as pilgrims with animals ready to be sacrificed hoping that the Quraysh would allow them access. However, they were prevented access by a Meccan contingent which met them outside the city. Rather than resorting to conflict (which the prophet and the Muslims were both unprepared for and unwilling) Muhammad, in negotiations with the Meccans, came to an agreement, and thus the Treaty of Hudaybiyyah was drawn up.
According to Islamic sources the Treaty of Hudaybiyyah was a huge source of embarrassment for Muhammad and his fellow Muslims. In signing the treaty, Muhammad both refused to use the name of Allah and call himself the Messenger of God. This greatly angered Umar, the senior companion to the prophet, who subsequently doubted if Muhammad was really the Messenger of God. However, despite this unexpected embarrassment the Muslims continued to follow the prophet Muhammad, and while on rout back to Medina, the prophet claimed to receive a revelation from Allah revealing that, despite the obvious appearance of his failure, the treaty was in fact a “manifest victory” (Quran 48:1) and that God would allow them to enter the Ka’bah in the future (Quran 48:27).
However, there still remained doubts within the ranks of the prophet’s followers over whether or not the failure was really a victory at all. Muhammad then received a further revelation from Allah promising him that he would capture “much booty” and that this would be a “sign to the believers” (48:20). In order to fulfill this promise, Muhammad attacked the Jews living in Khaybar where he plundered their wealth.
The Treaty of Hudaybiyyah assisted many people in converting to Islam during the time. For one, it introduced a time of peace between Muhammad and the powerful Quraysh, and Muhammad could continue expanding his community and fighting forces. Muhammad’s base in Medina was also recognized by the Meccans as an official state, and in just two years the prophet would return to Mecca and conquer the city.