Ouraysh had tried to destroy Islam but had failed. The number of Muslims grew and their armies increased from three hundred at the battle of Badr, seven hundred at the battle of "Uhud, to three thousand at the battle of the Trench. After the annual fast of Ramadan, the Prophet (pbuh) had a dream, which indicated that the Muslims should go to Mecca for the pilgrimage. One thousand and four hundred Muslims got ready to go with him on the Lesser Pilgrimage called 'the `Umra'. They dressed in white and went unarmed to show Quraysh that they had come to make the pilgrimage and not to fight. When Quraysh heard that the Prophet (pbuh) was on his way, they sent troops with Khalid Ibn al-Walid to stop the Muslims from entering the city. To avoid meeting this small army the Prophet (pbuh) changed his route and led the men through rugged mountain passes. When they reached easier ground he told them, 'Say, we ask Allah's forgiveness and we repent towards Him 'At Hudaybiyah, south of Mecca, the Prophet's camel knelt down and refused to go any further. The Muslims thought she was either stubborn or tired, but the Prophet (pbuh) said: 'The same power that once stopped the elephant from entering Mecca is now stopping us!' He then ordered them to make camp, which they did, although they all hoped they would travel on to the sacred Ka'bah the following day.
On setting up camp, the believers were dismayed to find that the springs were almost dry. When he heard this the Messenger of Allah (pbuh) instructed a man called Najiyah to take the bowl of water in which he had performed his ablutions, pour it into the hollows where the small amount of spring water lay, and stir it with his arrows. Najiyah did as he was told and the fresh water gushed up so suddenly that he was hardly able to get out of the way in time.
Messengers were sent to Quraysh to tell them that the Muslims had come only for the pilgrimage, to worship Allah at the Holy Ka'bah, and that they wanted to enter the city peacefully. But Quraysh took no notice. Finally, the Prophet's son-in-law, 'Uthman Ibn Affan, a wise and respected man, was chosen to go, and the Muslims settled down to wait and see what news he would bring back. After they had waited a long time, the Muslims became very worried. At last they decided that he must have been killed. A state similar to that of Revelation then came upon the Prophet (pbuh). He gathered the Muslims around him under an acacia tree and asked them to swear their allegiance to him, which they did. This pact, which is mentioned in the Koran, became known as the Treaty of Radwan (which means Paradise). Shortly after, `Uthman Ibn Affan returned and the Muslims were relieved to see that no harm had come to him. Some Meccan warriors tried to attack the Muslim camp but were captured and brought before the Prophet (pbuh), who forgave them when they promise to stop attacking the Muslims. Soon after this, official messengers came from Quraysh and talks began for a peaceful settlement. A man called Suhayl ibn 'Amr was sent by the Meccans to work out a treaty. When the Prophet (pbuh) asked 'Ali to write 'In the Name of Allah, the Most Gracious, the Most Merciful', on the top of the page, Suhayl objected, saying 'Write only: bismik Allahumma (in Thy name, 0 Allah). I don't know him as al-Rahman (the Most Gracious), al-Rahim (the most Merciful).' The Prophet (pbuh) agreed and dictated: 'This is a treaty between Muhammad the Messenger of Allah and Suhayl ibn 'Amr.''Stop!' cried Suhayl, 'I don't believe that you are Rasulallah (the Messenger of Allah). If I thought you were Allah's Messenger, I wouldn't be fighting against you, would I?' Calmly, the Prophet (pbuh) agreed that he should be referred to in the treaty as Muhammad', son of 'Abd Allah. The Muslims were very upset at this, and 'Umar furiously cried out, 'Are you not Allah's Messenger, and are we not Muslims? How can we accept such treatment when we are right and they are wrong? This will make people laugh at our religion!' But the Prophet (pbuh) knew what was best and the Treaty of Hudaybiyah was signed.
In this treaty the two sides agreed to stop fighting for a period often years. It was also agreed that the Muslims should go back to Medinah immediately but that they could return the following year for the pilgrimage. This pilgrimage would last three days. In addition, the treaty allowed Muslims wishing to leave Islam and return to Mecca to do so.
It also permitted Meccans to leave and become Muslims provided they had the permission of their guardians. The Muslims agreed to send any Meccan who did not have their guardian's permission back to Mecca.
Suhayl's son had come with his father with the idea of joining the Prophet (pbuh) but when the treaty was signed he was, of course, forced to return to Mecca. He cried bitterly. The Prophet (pbuh) said, '0 Abu Jandal, be patient and control yourself. Allah will provide relief and find a way out for you and others like you.'
The majority of the Muslims were very disappointed when they heard the terms of the agreement and thought that it should not have been accepted. They did not realize that this was in fact a great victory for the Prophet (pbuh), which Allah would later confirm in a Revelation. The agreement made sure that the following year they would enter Mecca peacefully, and in time would result in Muslims becoming stronger and more respected throughout Arabia. At the time the treaty was signed the Muslims could not have foreseen that the number of people who would travel to Medinah to become Muslims in following year would be greater than in all the years before. Before the Muslims departed, they followed the Prophet's example of making sacrifice and either shaving or cutting their hair. Even though they were unable to visit the sacred mosque, their pilgrimage was accepted by Allah because it had been their true intention.
On the return journey to Medinah, the 'Victory' chapter of the Koran was revealed to the Prophet (pbuh). It begins:
In the Name of Allah, the Beneficent, the Merciful
“Surely We have given thee (0 Muhammad) a clear victory, That Allah may forgive thee of thy sin That which is past and that which is to come, And may complete His blessings upon thee, And may guide thee on the right path, And that Allah may help thee with mighty help”. (Koran xlviii.1-3)
Now most of those who left Mecca to join the Prophet (pbuh) without the consent of their guardians and were turned back by him as agreed, Did not in fact return to Mecca, but lived instead in groups along the seashore. Then they were joined by others who had left Mecca but these groups began to endanger Quraysh caravans which were passing by and disrupted their trade because of this, Quraysh told the Prophet (pbuh) that if he wanted to take these new Muslims, they would not ask for them to be returned. The young men, therefore, joined the Prophet (pbuh) and the people in Mecca and Medinah grew more at ease with one another. The young men from the seashore were shortly followed by those Muslims who were still living in Abyssinia, and soon the numbers of believers in Medinah had doubled.
About this time, Khalid Ibn al-Walid, the great warrior who had defeated the Muslims at Uhud, set out from Mecca for Medinah. Along the way he met 'Amr Ibn al-'As, the clever speaker who had pursued the Muslims when they fled to Abyssinia. 'Amr, who had attempted to find asylum in Abyssinia, had just returned from that country, the Negus having urged him to enter Islam. He asked Khalid, 'Where are you going?' Khalid replied, 'The way has become clear. The man is certainly a Prophet, and by Allah, I am going to become a Muslim. How much longer should I delay?' 'Amr Ibn al-As answered, 'I am travelling for the same reason. So they both traveled on to Medinah to join the Prophet(pbuh). The two men were, however, worried about meeting the Prophet (pbuh) because of having fought against the Muslims in the past.
Therefore, 'Amr came before Allah's Messenger he said, 'O Prophet, will my past faults be forgiven and no mention made of what has gone before?' The Prophet (pbuh) replied, 'Amr, Islam wipes away everything that happened before, as does the hijrah.'
A year after the signing of the Treaty of Hudaybiyah, the Prophet (pbuh) was able to lead two thousand pilgrims on the 'Umra. Quraysh vacated Mecca and watched the rites from the hills above the city. The agreed period of three days was observed, after which the Muslims returned to Medinah.