It is a fact that the first open declaration of prophethood was the very occasion when the first open declaration of Ali's caliphate was made. It was at the time of the "Feast of the Clan."
When the verse: "And warn thy nearest relations (26:214), was revealed, the Prophet (S) ordered Ali to prepare food and invite the sons of 'Abd-ul-Muttalib so that he could convey to them the words of Allah. After the feast, the Prophet (S) intended to talk to them, but Abu Lahab interfered by saying: "Verily, your comrade has entranced you". Upon hearing this statement all of them dispersed.
The next day, the Messenger of Allah again called them for a feast. After they had finished with their food, the Prophet (S) addressed them: "O sons of 'Abd-ul-Muttalib, I have brought for you the good of this world and the next, and I have been appointed by the Lord to call you unto Him. Therefore, who amongst you will administer this cause for me and be my brother, my successor and my caliph?" No one responded to the Prophet's call except Ali (AS) who was the youngest of the congregation. The Prophet (S) then patted Ali's neck and said: "O my people! This Ali is my brother, my successor and my caliph amongst you. Listen to him and obey him.''
It is interesting to note here that the Leiden edition (1879 C.E., p. 1173) of at-Tarikh of at-Tabari records the words of the Prophet (S) as "wasiyyi wa khalifati" (my successor and my caliph).
Verse of Mastership (Wilayah)
After that, on many occasions, many verses and traditions reminded the Muslims that Ali (AS) was their master after the Prophet (S). One of the most important verses is as follows:
Verily, your Master is only Allah and His Apostle and those who believe, those who establish prayers, and pay the zakat while bowed (in worship). (5:55)
The Muslim scholars, Sunni and Shia alike, agree that this verse was revealed in honor of Imam Ali (AS). It clearly shows that there are only three masters of the believers. Firstly, Allah secondly, His Prophet (S) and thirdly, Ali (with the eleven succeeding Imams).
Abu Dharr al-Ghifari says that one day he was praying with the Prophet (S) when a beggar came to the Prophet's mosque. No one responded to his pleas. The beggar raised his hands towards heavens and said, "Allah! be a witness that I came to Thy Prophet's mosque and no one gave me anything". Ali (AS) was bowing in ruku' at that time. He pointed his little finger, on which was a ring, towards the beggar who came forward and took away the ring. This incident occurred in the Prophet's presence who raised his face towards heaven and prayed: "O Lord! my brother Musa had begged of Thee to open his breast and to make his work easy for him, to loose the knot of his tongue so that people might understand him, and to appoint from among his relations his brother, as his vizier, and to strengthen his back with Harun and to make Harun his partner in his work. O Allah! Thou said to Musa, 'We will strengthen thy arm with thy brother. No one will now have an access to either of you!' O Allah! I am Muhammad and Thou hast given me distinction. Open my breast for me, make my work easy for me, and from my family appoint my brother Ali as my vizier. Strengthen my back with him". The Prophet (S) had not yet finished his prayers when Jibril brought the above quoted verse.
Here is not the place to give all the references of this hadith. (They run in the hundreds.) This verse and the prayer of the Prophet (S) jointly and separately show that A1i (AS) was designated to be the Master of the Muslims after the Prophet (S).
The Formal Declaration of Ghadir Khumm
All the previous declarations may be classified as a prelude to the formal declaration of Ghadir Khumm.
This event has been unanimously described by the learned historians and scholars of both sects. Here we give a brief account to show what great arrangements were made to declare Ali (AS) as the successor to the Prophet (S).
Ghadir Khumm lies in Juhfa between Mecca and Medina. When the Prophet (S) was on his way home, after performing his last pilgrimage, Jibril brought him this urgent command of Allah:
O Apostle! deliver what has been sent down to you from your Lord; and if you do it not, then you have not delivered His message (at all); and Allah will protect you from the people… (5:67)
The Prophet (S) stopped at once and ordered that all people who had gone ahead should be called back, and he waited for those who were following. When the entire caravan had gathered, a pulpit was set up by piling up camel saddles; the acacia thorns were swept away. The Prophet (S) ascended the pulpit and delivered a long sermon. The day was very hot; people had to stretch their cloaks under their feet and over their heads. The Prophet (S) addressed them as follows: O you people! Know it well that Jibril came down to me several times bringing me orders from the Lord, the Merciful, that I should halt at this place and inform every man, white and black, that Ali, the son of Abu Talib, is my brother and my wasiyy (successor) and my caliph, and the Imam after me. His position to me is like that of Harun to Musa, except that there is to be no prophet after me, and he is your master next to Allah and His Prophet.
O you people! Verily, Allah has appointed him to be your Imam and ruler. Obedience to him is obligatory alike on all the Muhajirun (Emigrants) and Ansar (Helpers) and on those who follow them in virtue, and on the dwellers in cities and the nomads, the Arabs and the non-Arabs, the freeman and the slave, the young and the old, the great and the small, the white and the black. His command is to be obeyed, his word is binding and his orders obligatory on everyone believing in the One God. Cursed is the man who disobeys him and blessed is he who follows him, and he who believes in him is a true believer.
O you people! This is the last time I shall stand in this assembly. Therefore, listen and obey and surrender to the command of your Lord. Verily, Allah, He is your Lord and God; then after Him, His Prophet, Muhammad, who is addressing you, is your Master, then after me Ali is your Master and your Imam, according to Allah's command. Then after him the Imamate will continue through my descendants begotten by him till the day you meet Allah and His Prophet. O you people! Meditate on the Quran and understand its verses; reflect over its clear verses and do not go to the ambiguous ones. For, by Allah, none will properly explain to you its warnings and expound to you its meanings except this man (i.e., Ali) whose hand I am lifting up in front of myself. And I say unto you that whomsoever I am his Master, Ali is his Master; and he is Ali, the son of Abu Talib, my brother and wasiyy (successor); and wilayah (obedience to him and love for him) has been made obligatory by Allah, the Powerful, the Exalted.
The other Imams have also been briefly referred to in this address; and they are mentioned in precise detail in many other traditions. For example, on one occasion addressing Imam Hussein (AS), the Prophet (S) said: “You are an Imam, the son of an Imam, the brother of an Imam, nine of your lineal descendants will be pious Imams; the ninth of them being their Qa'im (he who will rise).”
Even a casual observer would not fail to realize that it was a matter of vital importance to Islam and that is why the Prophet (S), under the Divine Command, made all the possible preparations to accomplish it. Exposed to the scorching rays of the midday sun, he mounted the pulpit to make the important pronouncement.
First of all, he informed the audience of his approaching end and then called them to witness that he had faithfully discharged his duties. Then he asked them: "Do I not have more authority upon you than you yourselves have. All of them cried out that he certainly had more right on them than they themselves had. The Prophet (S) then said: “Whomsoever I am his Master, Ali is his Master.” In the end he invoked blessings on Ali, saying: “O Allah! Love him who loves Ali, and be the enemy of the enemy of Ali; help him who helps Ali, and forsake him who forsakes Ali.”
When the ceremony was over, the following verse of the Quran was revealed:
This day I have perfected your religion for you and I have completed My bounty upon you and I have approved Islam as your religion. (5:3)
This Divine Communication clearly shows that because of Ali's appointment to the Imamate the religion was perfected, the bounty and favor of Allah completed, and Islam approved by Allah. On the arrival of this glad tiding from heaven the believers congratulated Ali (AS) in the Prophet's presence and many poets composed poems on this event.
An excerpt of the book “Imamate, the Vicegerency of the Prophet (S)” by Seyyed Sa'id Akhtar Rizvi.