The Prophet (s) went for his last pilgrimage in Dhu al-Qi'da, 10 AH. He taught the rulings of the hajj in this hajj journey. The Quraysh had saved some privileges for themselves, the same privileges that they had before the advent of Islam. In addition to key-holding, managing, and giving water to the hajj pilgrims, they regarded themselves as separate from and superior to the other tribes in doing rituals.
In this last hajj journey, the Prophet (s) negated the privileges that the Quraysh had held for themselves, and deprived others from. Among the things abolished was the purchase of clean clothing for the pilgrimage permitted only through the Quraysh. There was a custom that the clean clothes required for the pilgrimage could only be bought from the Quraysh, and if they were not, they had to circumambulate the kaaba naked.
Another practice abolished was that the Quraysh moved out from Muzdalifa, as opposed to 'Arafat as all other hajj pilgrims did. They believed this to be an honor for themselves, but the Qur'an nullified this privilege:
"Then stream out from where the people stream out…" (2:199)
The Muslims saw that Muhammad (s) was from Quraysh, but that he was moving out from 'Arafat like all of the others. It was in this journey that the Prophet (s) told the people, "O people! I don't know if I will see the next year. I ignored all of the blood that was spilt before the advent of Islam. [From now on], your blood and your other possessions are forbidden for each other until you meet God."
In a region called Juhfa where the peoples of Egypt, Hijaz and Iraq split up to travel to their own regions, is a place called Ghadir Khum. Here, on the Prophet's (s) return to Medina, before everyone split in different directions, he received an order from God to appoint Ali (a) as his successor and who would direct the Muslim community towards a specific goal.
In the massive crowd of Muslims, approximated at 90-100,000, the Prophet (s) said, "Ali (a) is the guardian of anyone that I am the guardian of. O Allah! Befriend anyone who befriends him and be enemies with whoever is his enemy. Abominate whoever abominates him, help whoever helps him, defame whoever disrespects him, and support him with the truth wherever he goes. Deliver these words to those who are absent."
After returning from the hajj, when the glory and power of Islam had grown, the Prophet (s) became sick. Nevertheless, he had prepared an army under the leadership of Osama b. Zayd in order to respond to the Muslims' defeat in the battle of Muta. However, before this army left for the battle, the Prophet (s) passed away and left this world to meet his Lord. He passed away at a time when he had established unity throughout the entire Arabian Peninsula and had brought Islam to the gates of the two great empires of Rome and Iran.